Received: by 10.192.165.148 with SMTP id m20csp2824485imm; Mon, 7 May 2018 01:40:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq2paiSVow3/UqZ4nhB8O59SvslpdYlrsx1Pb1/7cE6ZmbmuH9nww/OcWBNITW7oK2OQoJJ X-Received: by 2002:a63:6441:: with SMTP id y62-v6mr30016508pgb.362.1525682451180; Mon, 07 May 2018 01:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525682451; cv=none; d=google.com; s=arc-20160816; b=vdb69P5au2jyaH0QP9RoUZ+std6oi4csCUrPCfjMD3GlNzP8LEv6vrYxSaNFYY+I4G CwR3K2ROyYKokeBsOnQ3I4U1LnsZ6kKeW+bBnxQ0BrgIsCHrl6O8xUqKVnQO+p/yZH7V VjffXNrBuWMucr8+vYU/hErytg0gMLF/U0BWABWDWhMCoL4MKbT7DrSyJr2hQ/Tl2Cqk inFqyrDlDsP2XOJEx+/B1Qzo79F/u7bVm73HGc5HkDcxzsSa6asU2CTKTNje2epE7TJX rMbseyDEF7UzXlpEJYwKjVx46R0D1e6UEmJvjgUs1K9fwfOJuPHl2t89Jqm8dTKFH5bD lUxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=EBEyBbqX9UbP7p8udqxnyX4KQqFGOzlOw0RZmVtI6C4=; b=QvDdyNV4jzos/YvGBqIaHpHzPYX0EoMwLGSHTrDtahKSEJsymH8tnks4lu8ERMaaAG qh/77WP1uzylo0NeFrFtY1vYwrXunTg09Rk831gIFd/yOmMZfnU9oFoOfwAmEv7XnObR zr6yq/4ZBr1WYcKWLDUIuyiWXpC4IPLwt/k8OO1Azh8hVFerwT04LKPHJdAJuPJUQi2c 430VAOD0AzspGKTTJko5gb8JWcrgcI4aV+2Kk/LxdJojaP+J70xNSNBqzNKULsVUSoNm hbG0yvgUyrLy1Vp4IsqQwrAy9y9+CBvpcIKJ2brWTSwVVF5TpFYE8RZYEWwE6/qgQH1L eDtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3-v6si21419294pld.96.2018.05.07.01.40.36; Mon, 07 May 2018 01:40:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbeEGIjX (ORCPT + 99 others); Mon, 7 May 2018 04:39:23 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42196 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbeEGIis (ORCPT ); Mon, 7 May 2018 04:38:48 -0400 Received: by mail-wr0-f196.google.com with SMTP id v5-v6so27852869wrf.9 for ; Mon, 07 May 2018 01:38:47 -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=EBEyBbqX9UbP7p8udqxnyX4KQqFGOzlOw0RZmVtI6C4=; b=KpRMNygmQXC36YEGzRcUxFvg8KYV1bwWIlwF78C5Yc1H+wUgxpXbePBIG2Tawpo+1C 2cNbcbJV+pfJAJ7B4/f1AlA/WEBBn3MOstMvafl57Jz/T6AFOt4ndYprC1E2irDxhlNP Q8dOKWvMwaebpaRuluGSxBszk7YOsBtpq86Efl1n6T2xazQGSilm21QNjpzLBETyATnQ SAdR5WJaApLkk5dhWAy0oUWJhUwmCJeLVoxPIozzIARP0+5gR6RK3Has9lsgj9vDgspg XBpX0gXtnCEgrM2hgdYajuYKgCiUYu/wzZ7KeX6gLQePhpyP3mbo4DTCKvCYiZRx47AY BYhA== X-Gm-Message-State: ALQs6tBQvg7OmELOTUla46onxVLosAbZ5VLrdAuQWVHCjkX05cMBT3nF 5Boejrg90dHLhRF5+q+cNeN5pA== X-Received: by 2002:adf:8ea5:: with SMTP id q34-v6mr26630519wrb.245.1525682326658; Mon, 07 May 2018 01:38:46 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:46 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH v2 30/35] Revert "vfs: add flags to d_real()" Date: Mon, 7 May 2018 10:38:02 +0200 Message-Id: <20180507083807.28792-31-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-1-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 2db39216c393..127b49819afb 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 b2b829bcb7c0..58fcc66ddccd 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -146,7 +146,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; /* @@ -567,8 +567,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. @@ -577,10 +576,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; } @@ -595,7 +594,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 ebe311541873..ba3078693d4a 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) -- 2.14.3