From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754092AbcK1CMK (ORCPT ); Sun, 27 Nov 2016 21:12:10 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:45882 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754060AbcK1CL5 (ORCPT ); Sun, 27 Nov 2016 21:11:57 -0500 X-ME-Sender: X-Sasl-enc: UBwMYr6a9qYt9TqgowhGSDnqJOULTLrB0luKox9aB/My 1480299116 Subject: [PATCH 2/7] autofs - make struct path const in autofs4_dir_open() 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:54 +0800 Message-ID: <148029911386.27779.14131036159082881283.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 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 Cc: Al Viro Cc: Eric W. Biederman Cc: Omar Sandoval --- 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; }