From patchwork Thu Apr 12 15:08:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10338715 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 B3E2D602D8 for ; Thu, 12 Apr 2018 15:12:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A94C426255 for ; Thu, 12 Apr 2018 15:12:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E1F027D4A; Thu, 12 Apr 2018 15:12:13 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 0689426255 for ; Thu, 12 Apr 2018 15:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbeDLPMJ (ORCPT ); Thu, 12 Apr 2018 11:12:09 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:46481 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753666AbeDLPJF (ORCPT ); Thu, 12 Apr 2018 11:09:05 -0400 Received: by mail-wr0-f195.google.com with SMTP id d1so5453950wrj.13 for ; Thu, 12 Apr 2018 08:09:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PYj6NQjaVI1iyXuau7ZTo9dP1cZsmsOzTg1fUaZufsw=; b=JarlZlYlSWAIa7Kp3Lj5E9qmk5zLKtNQ+Q6G9LeGIQXeIJf3icHLbfkpjLUcfH3if8 RGZ8hu9XsFP4vxE9f4nuY+qnbvAPRYo/pIN5bCuBeqef7G9UXJb9xIolSn6VAkX6Cuax RwCyGGebTNhDO16CjoeEl9j9zFFvym0oBsbx69vYTThh2Yoc7Jp1TY2DFLeIH2yUWuEt UeH6/+nRLj2zyf0bRq0lXwclz4iWtOYGaJVWI55xjbGoeJu+445XUj1BgNOlNPyko5CX VBH7nPhbh767Emo4DMDP3jD9GsUCdakKx8mqkSUFnKhvouenAWLfsCj06y+zMomXH0kL xWdA== X-Gm-Message-State: ALQs6tDNVtKJ891McHeS6dU5oD1HDHIz8TK3whKU11Nys4HmTzi41cG/ pRdLVIcNBnWvc8Iw9JAqlyUjEw== X-Google-Smtp-Source: AIpwx490My0v1aokR4MHfG8krTUjhgKCBvrDAygZnnkV0Ykaex6lOBT2c/NpdgSEuEn1iwsl8B+4aQ== X-Received: by 10.223.141.144 with SMTP id o16mr217564wrb.81.1523545744243; Thu, 12 Apr 2018 08:09:04 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id p197sm2621783wme.43.2018.04.12.08.09.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 08:09:03 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 28/35] Revert "vfs: add flags to d_real()" Date: Thu, 12 Apr 2018 17:08:19 +0200 Message-Id: <20180412150826.20988-29-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180412150826.20988-1-mszeredi@redhat.com> References: <20180412150826.20988-1-mszeredi@redhat.com> 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 This reverts commit 495e642939114478a5237a7d91661ba93b76f15a. No user of "flags" argument of d_real() remain. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 2 +- Documentation/filesystems/vfs.txt | 2 +- fs/open.c | 2 +- fs/overlayfs/super.c | 4 ++-- include/linux/dcache.h | 11 +++++------ include/linux/fs.h | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 60e76060baff..a4afe96f0112 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -22,7 +22,7 @@ prototypes: struct vfsmount *(*d_automount)(struct path *path); int (*d_manage)(const struct path *, bool); struct dentry *(*d_real)(struct dentry *, const struct inode *, - unsigned int, unsigned int); + unsigned int); locking rules: rename_lock ->d_lock may block rcu-walk diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 2bc77ea8aef4..af54d3651ff8 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -991,7 +991,7 @@ struct dentry_operations { struct vfsmount *(*d_automount)(struct path *); int (*d_manage)(const struct path *, bool); struct dentry *(*d_real)(struct dentry *, const struct inode *, - unsigned int, unsigned int); + unsigned int); }; d_revalidate: called when the VFS needs to revalidate a dentry. This diff --git a/fs/open.c b/fs/open.c index 00b1f18475ba..73f3d0f35742 100644 --- a/fs/open.c +++ b/fs/open.c @@ -96,7 +96,7 @@ long vfs_truncate(const struct path *path, loff_t length) * write access on the upper inode, not on the overlay inode. For * non-overlay filesystems d_real() is an identity function. */ - upperdentry = d_real(path->dentry, NULL, O_WRONLY, 0); + upperdentry = d_real(path->dentry, NULL, O_WRONLY); error = PTR_ERR(upperdentry); if (IS_ERR(upperdentry)) goto mnt_drop_write_and_out; diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 006dc70d7425..7779fc610767 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -98,7 +98,7 @@ static int ovl_check_append_only(struct inode *inode, int flag) static struct dentry *ovl_d_real(struct dentry *dentry, const struct inode *inode, - unsigned int open_flags, unsigned int flags) + unsigned int open_flags) { struct dentry *real; int err; @@ -134,7 +134,7 @@ static struct dentry *ovl_d_real(struct dentry *dentry, goto bug; /* Handle recursion */ - real = d_real(real, inode, open_flags, 0); + real = d_real(real, inode, open_flags); if (!inode || inode == d_inode(real)) return real; diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 4c7ab11c627a..8ca25ea3b9db 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -148,7 +148,7 @@ struct dentry_operations { struct vfsmount *(*d_automount)(struct path *); int (*d_manage)(const struct path *, bool); struct dentry *(*d_real)(struct dentry *, const struct inode *, - unsigned int, unsigned int); + unsigned int); } ____cacheline_aligned; /* @@ -569,8 +569,7 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper) * d_real - Return the real dentry * @dentry: the dentry to query * @inode: inode to select the dentry from multiple layers (can be NULL) - * @open_flags: open flags to control copy-up behavior - * @flags: flags to control what is returned by this function + * @flags: open flags to control copy-up behavior * * If dentry is on a union/overlay, then return the underlying, real dentry. * Otherwise return the dentry itself. @@ -579,10 +578,10 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper) */ static inline struct dentry *d_real(struct dentry *dentry, const struct inode *inode, - unsigned int open_flags, unsigned int flags) + unsigned int flags) { if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) - return dentry->d_op->d_real(dentry, inode, open_flags, flags); + return dentry->d_op->d_real(dentry, inode, flags); else return dentry; } @@ -597,7 +596,7 @@ static inline struct dentry *d_real(struct dentry *dentry, static inline struct inode *d_real_inode(const struct dentry *dentry) { /* This usage of d_real() results in const dentry */ - return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0, 0)); + return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0)); } struct name_snapshot { diff --git a/include/linux/fs.h b/include/linux/fs.h index 5e5dd484937f..5294697217b7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1244,7 +1244,7 @@ static inline struct inode *file_inode(const struct file *f) static inline struct dentry *file_dentry(const struct file *file) { - return d_real(file->f_path.dentry, file_inode(file), 0, 0); + return d_real(file->f_path.dentry, file_inode(file), 0); } static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl)