From: Ian Kent <ik...@redhat.com>

There's no reason to copy the file->f_path in autofs4_dir_open() and
f_path is not modified so change it to a "const struct path *".

Signed-off-by: Ian Kent <ra...@themaw.net>
Cc: Al Viro <v...@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebied...@xmission.com>
Cc: Omar Sandoval <osan...@osandov.com>
---
 fs/autofs4/root.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index dd2ea5d..3e33f00 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -107,14 +107,14 @@ static int autofs4_dir_open(struct inode *inode, struct 
file *file)
 {
        struct dentry *dentry = file->f_path.dentry;
        struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
-       struct path path;
+       const struct path *path;
 
        pr_debug("file=%p dentry=%p %pd\n", file, dentry, dentry);
 
        if (autofs4_oz_mode(sbi))
                goto out;
 
-       path = file->f_path;
+       path = &file->f_path;
 
        /*
         * An empty directory in an autofs file system is always a
@@ -126,7 +126,7 @@ static int autofs4_dir_open(struct inode *inode, struct 
file *file)
         * it.
         */
        spin_lock(&sbi->lookup_lock);
-       if (!path_is_mountpoint(&path) && simple_empty(dentry)) {
+       if (!path_is_mountpoint(path) && simple_empty(dentry)) {
                spin_unlock(&sbi->lookup_lock);
                return -ENOENT;
        }

Reply via email to