Skip to content

Commit 1f6df58

Browse files
author
Al Viro
committed
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>
1 parent 6e024a0 commit 1f6df58

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

fs/namespace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,9 +2334,9 @@ struct path *collect_paths(const struct path *path,
23342334
return res;
23352335
}
23362336

2337-
void drop_collected_paths(struct path *paths, struct path *prealloc)
2337+
void drop_collected_paths(const struct path *paths, struct path *prealloc)
23382338
{
2339-
for (struct path *p = paths; p->mnt; p++)
2339+
for (const struct path *p = paths; p->mnt; p++)
23402340
path_put(p);
23412341
if (paths != prealloc)
23422342
kfree(paths);

include/linux/mount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extern int may_umount(struct vfsmount *);
105105
int do_mount(const char *, const char __user *,
106106
const char *, unsigned long, void *);
107107
extern struct path *collect_paths(const struct path *, struct path *, unsigned);
108-
extern void drop_collected_paths(struct path *, struct path *);
108+
extern void drop_collected_paths(const struct path *, struct path *);
109109
extern void kern_unmount_array(struct vfsmount *mnt[], unsigned int num);
110110

111111
extern int cifs_root_data(char **dev, char **opts);

kernel/audit_tree.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ void audit_trim_trees(void)
678678
struct audit_tree *tree;
679679
struct path path;
680680
struct audit_node *node;
681-
struct path *paths;
681+
const struct path *paths;
682682
struct path array[16];
683683
int err;
684684

@@ -701,7 +701,7 @@ void audit_trim_trees(void)
701701
struct audit_chunk *chunk = find_chunk(node);
702702
/* this could be NULL if the watch is dying else where... */
703703
node->index |= 1U<<31;
704-
for (struct path *p = paths; p->dentry; p++) {
704+
for (const struct path *p = paths; p->dentry; p++) {
705705
struct inode *inode = p->dentry->d_inode;
706706
if (inode_to_key(inode) == chunk->key) {
707707
node->index &= ~(1U<<31);
@@ -740,9 +740,9 @@ void audit_put_tree(struct audit_tree *tree)
740740
put_tree(tree);
741741
}
742742

743-
static int tag_mounts(struct path *paths, struct audit_tree *tree)
743+
static int tag_mounts(const struct path *paths, struct audit_tree *tree)
744744
{
745-
for (struct path *p = paths; p->dentry; p++) {
745+
for (const struct path *p = paths; p->dentry; p++) {
746746
int err = tag_chunk(p->dentry->d_inode, tree);
747747
if (err)
748748
return err;
@@ -805,7 +805,7 @@ int audit_add_tree_rule(struct audit_krule *rule)
805805
struct audit_tree *seed = rule->tree, *tree;
806806
struct path path;
807807
struct path array[16];
808-
struct path *paths;
808+
const struct path *paths;
809809
int err;
810810

811811
rule->tree = NULL;
@@ -877,7 +877,7 @@ int audit_tag_tree(char *old, char *new)
877877
int failed = 0;
878878
struct path path1, path2;
879879
struct path array[16];
880-
struct path *paths;
880+
const struct path *paths;
881881
int err;
882882

883883
err = kern_path(new, 0, &path2);

0 commit comments

Comments
 (0)