drop_collected_paths(): constify arguments

... and use that to constify the pointers in callers

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2025-07-06 18:45:02 -04:00
parent 6e024a0e28
commit 1f6df58474
3 changed files with 9 additions and 9 deletions

View File

@@ -2334,9 +2334,9 @@ struct path *collect_paths(const struct path *path,
return res;
}
void drop_collected_paths(struct path *paths, struct path *prealloc)
void drop_collected_paths(const struct path *paths, struct path *prealloc)
{
for (struct path *p = paths; p->mnt; p++)
for (const struct path *p = paths; p->mnt; p++)
path_put(p);
if (paths != prealloc)
kfree(paths);

View File

@@ -105,7 +105,7 @@ extern int may_umount(struct vfsmount *);
int do_mount(const char *, const char __user *,
const char *, unsigned long, void *);
extern struct path *collect_paths(const struct path *, struct path *, unsigned);
extern void drop_collected_paths(struct path *, struct path *);
extern void drop_collected_paths(const struct path *, struct path *);
extern void kern_unmount_array(struct vfsmount *mnt[], unsigned int num);
extern int cifs_root_data(char **dev, char **opts);

View File

@@ -678,7 +678,7 @@ void audit_trim_trees(void)
struct audit_tree *tree;
struct path path;
struct audit_node *node;
struct path *paths;
const struct path *paths;
struct path array[16];
int err;
@@ -701,7 +701,7 @@ void audit_trim_trees(void)
struct audit_chunk *chunk = find_chunk(node);
/* this could be NULL if the watch is dying else where... */
node->index |= 1U<<31;
for (struct path *p = paths; p->dentry; p++) {
for (const struct path *p = paths; p->dentry; p++) {
struct inode *inode = p->dentry->d_inode;
if (inode_to_key(inode) == chunk->key) {
node->index &= ~(1U<<31);
@@ -740,9 +740,9 @@ void audit_put_tree(struct audit_tree *tree)
put_tree(tree);
}
static int tag_mounts(struct path *paths, struct audit_tree *tree)
static int tag_mounts(const struct path *paths, struct audit_tree *tree)
{
for (struct path *p = paths; p->dentry; p++) {
for (const struct path *p = paths; p->dentry; p++) {
int err = tag_chunk(p->dentry->d_inode, tree);
if (err)
return err;
@@ -805,7 +805,7 @@ int audit_add_tree_rule(struct audit_krule *rule)
struct audit_tree *seed = rule->tree, *tree;
struct path path;
struct path array[16];
struct path *paths;
const struct path *paths;
int err;
rule->tree = NULL;
@@ -877,7 +877,7 @@ int audit_tag_tree(char *old, char *new)
int failed = 0;
struct path path1, path2;
struct path array[16];
struct path *paths;
const struct path *paths;
int err;
err = kern_path(new, 0, &path2);