[PATCH 3/7] autofs - change struct path to const in autofs4_expire_wait() and autofs4_wait()

From: Ian Kent
Date: Sun Nov 27 2016 - 21:12:28 EST


From: Ian Kent <ikent@xxxxxxxxxx>

The functions autofs4_expire_wait() and autofs4_wait() don't modify
the passed struct path so change it to a const.

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Cc: Omar Sandoval <osandov@xxxxxxxxxxx>
---
fs/autofs4/autofs_i.h | 5 +++--
fs/autofs4/expire.c | 4 ++--
fs/autofs4/root.c | 6 +++---
fs/autofs4/waitq.c | 4 ++--
4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 14cef41..c885daa 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -145,7 +145,7 @@ void autofs4_free_ino(struct autofs_info *);

/* Expiration */
int is_autofs4_dentry(struct dentry *);
-int autofs4_expire_wait(struct path *path, int rcu_walk);
+int autofs4_expire_wait(const struct path *path, int rcu_walk);
int autofs4_expire_run(struct super_block *, struct vfsmount *,
struct autofs_sb_info *,
struct autofs_packet_expire __user *);
@@ -217,7 +217,8 @@ static inline int autofs_prepare_pipe(struct file *pipe)

/* Queue management functions */

-int autofs4_wait(struct autofs_sb_info *, struct path *, enum autofs_notify);
+int autofs4_wait(struct autofs_sb_info *,
+ const struct path *, enum autofs_notify);
int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
void autofs4_catatonic_mode(struct autofs_sb_info *);

diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index a37ba40..13178bf 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -495,7 +495,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
return expired;
}

-int autofs4_expire_wait(struct path *path, int rcu_walk)
+int autofs4_expire_wait(const struct path *path, int rcu_walk)
{
struct dentry *dentry = path->dentry;
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
@@ -593,7 +593,7 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,

if (dentry) {
struct autofs_info *ino = autofs4_dentry_ino(dentry);
- struct path path = { .mnt = mnt, .dentry = dentry };
+ const struct path path = { .mnt = mnt, .dentry = dentry };

/* This is synchronous because it makes the daemon a
* little easier
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 3e33f00..859eef9 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -272,7 +272,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry,
return NULL;
}

-static int autofs4_mount_wait(struct path *path, bool rcu_walk)
+static int autofs4_mount_wait(const struct path *path, bool rcu_walk)
{
struct autofs_sb_info *sbi = autofs4_sbi(path->dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(path->dentry);
@@ -289,7 +289,7 @@ static int autofs4_mount_wait(struct path *path, bool rcu_walk)
return status;
}

-static int do_expire_wait(struct path *path, bool rcu_walk)
+static int do_expire_wait(const struct path *path, bool rcu_walk)
{
struct dentry *dentry = path->dentry;
struct dentry *expiring;
@@ -300,7 +300,7 @@ static int do_expire_wait(struct path *path, bool rcu_walk)
if (!expiring)
return autofs4_expire_wait(path, rcu_walk);
else {
- struct path this = { .mnt = path->mnt, .dentry = expiring };
+ const struct path this = { .mnt = path->mnt, .dentry = expiring };
/*
* If we are racing with expire the request might not
* be quite complete, but the directory has been removed
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index e7a037f..1278335 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -250,7 +250,7 @@ autofs4_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr)
static int validate_request(struct autofs_wait_queue **wait,
struct autofs_sb_info *sbi,
const struct qstr *qstr,
- struct path *path, enum autofs_notify notify)
+ const struct path *path, enum autofs_notify notify)
{
struct dentry *dentry = path->dentry;
struct autofs_wait_queue *wq;
@@ -349,7 +349,7 @@ static int validate_request(struct autofs_wait_queue **wait,
}

int autofs4_wait(struct autofs_sb_info *sbi,
- struct path *path, enum autofs_notify notify)
+ const struct path *path, enum autofs_notify notify)
{
struct dentry *dentry = path->dentry;
struct autofs_wait_queue *wq;