From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754135AbcK1CMT (ORCPT ); Sun, 27 Nov 2016 21:12:19 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:60298 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754066AbcK1CMD (ORCPT ); Sun, 27 Nov 2016 21:12:03 -0500 X-ME-Sender: X-Sasl-enc: L/m+faaROmw2l3c9oOJkW4H9cIRhTnnM1/NyG5jV8KPI 1480299121 Subject: [PATCH 3/7] autofs - change struct path to const in autofs4_expire_wait() and autofs4_wait() From: Ian Kent To: Andrew Morton Cc: autofs mailing list , Kernel Mailing List , "Eric W. Biederman" , linux-fsdevel , Omar Sandoval , Al Viro Date: Mon, 28 Nov 2016 10:11:59 +0800 Message-ID: <148029911911.27779.6329959807249612394.stgit@pluto.themaw.net> In-Reply-To: <148029910861.27779.4517883721395202453.stgit@pluto.themaw.net> References: <148029910861.27779.4517883721395202453.stgit@pluto.themaw.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ian Kent 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 Cc: Al Viro Cc: Eric W. Biederman Cc: Omar Sandoval --- 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;