From patchwork Mon Nov 28 02:11:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 9448943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA5516071C for ; Mon, 28 Nov 2016 02:12:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBC82204BF for ; Mon, 28 Nov 2016 02:12:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADE5A21050; Mon, 28 Nov 2016 02:12:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4898A204BF for ; Mon, 28 Nov 2016 02:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754070AbcK1CMF (ORCPT ); Sun, 27 Nov 2016 21:12:05 -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 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9AB5720926; Sun, 27 Nov 2016 21:11:56 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 27 Nov 2016 21:11:56 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=themaw.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=94Ogt+LkiVNgCMc /yc+KNocUitc=; b=UseRqgeNLKd8T6Iay46TIBvSxD32ibCv1mnUiDo9Tkr3oUB zeCuHUcO+1GKRvRuUeWGk9ACw9ysWTMGPcr//V8dDlv/ZUGpNjwn7u8XFpeSk7zG Q1Ge/HRMZrlYGApI8JJskxMjn/gnSfS8KvLXkxYnxPQpJHf6YcuIKvqfLl3Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=94Ogt+LkiVNgCMc/yc+KNocUitc=; b=fuzDXpdcIgzoaBdxm9hs rzCZQVfgAdM9Hsg0T6WJzlcjhNcvS5n8Qwj0lMTE9ZNpsdUnI018ONjPtGZefPeP 1j3xndFIeG0DHkPNpHAtHeaQiGhWP/cEv35NrflA/HfJ+LSr4pHa47hQol94vXAh RRK2zYu/obQKubL5vmrHiKA= X-ME-Sender: X-Sasl-enc: UBwMYr6a9qYt9TqgowhGSDnqJOULTLrB0luKox9aB/My 1480299116 Received: from pluto.themaw.net (106-69-59-107.dyn.iinet.net.au [106.69.59.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 11D8C24077; Sun, 27 Nov 2016 21:11:56 -0500 (EST) Received: from pluto.themaw.net (localhost [127.0.0.1]) by pluto.themaw.net (Postfix) with ESMTP id 088EEA006A; Mon, 28 Nov 2016 10:11:54 +0800 (AWST) 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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }