Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1098675ybe; Wed, 11 Sep 2019 09:20:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0+qRzY1YHW8QISdK75W/vLDj+fjhFUyfN5W02lll6hc0PVOneNyWR0MzLLLo5mkLQWmtq X-Received: by 2002:a17:906:f96:: with SMTP id q22mr8402093ejj.80.1568218812890; Wed, 11 Sep 2019 09:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568218812; cv=none; d=google.com; s=arc-20160816; b=y4XV39sUvh/7A9ZPMGYlckXnxNAKFm3TXS++osat7tGHUJuG9BjYbpWUiB5DGon2vY C1QuyFEyjYUuMXJhfBHev6K2HixtC2eTf4KufRZ8ktN+eUc6JOMnOZfZgtdcchfgR7Nb Slyzu8mMieKudjRkLjptAnphpSZ/kHnBLb/xE6E7Pvs3lT1TLxnOx0NndiDdhS4Xb4Dl FypEGkbT65mITFAEWNtDbfqn2TSciz1lk/XKfhEW8jGes/wl8Lp2CF/pqUXHr7AmUL50 VLip85gC7iMymRAWYgWDPCoGfVIYZLZP2EazXFPt56nVWtyT09tTWVVBmyUVjVqU3aeK EyNA== 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; bh=mOPUq03FRCZ5m+XYw1KTqdzyzTdpycG+SmTJ5pw9dPo=; b=SHtfS4PUmW41pLITPOL4tIAjf0ZfoNacDDMyb+mZkNDyXFeYSA4hgyhgT8oPmTWWdk szPcxCmUE4q7bQuno7bvsJzYSl6Rc7Sw9p5JYDu9pEjqjfH9yBRGeYq8NItQCH2mBBF8 uXmK/H572oMgms+b1hJ2+8VEQ7cnO7MsmwZvgsMX4iHwFcwF8+lUDaU+ojIa9N0vA1nE UJl2h9SNelVweXV+pToX0AqlxGxhBElbAnOM5TrqifoluVyhWSISJIIVMSpmmPHocG5S Rg3jQNRv8JfdeX3tJPAUnMLpLz2O2UsDMWQpIihSn0lPdDXMn7OPHHm+DwFBuCt03q7E Fk4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 c52si14579460eda.132.2019.09.11.09.19.48; Wed, 11 Sep 2019 09:20:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 S1729389AbfIKQSD (ORCPT + 99 others); Wed, 11 Sep 2019 12:18:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60540 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728974AbfIKQQX (ORCPT ); Wed, 11 Sep 2019 12:16:23 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24EE087630; Wed, 11 Sep 2019 16:16:23 +0000 (UTC) Received: from coeurl.usersys.redhat.com (ovpn-122-52.rdu2.redhat.com [10.10.122.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03B591001B01; Wed, 11 Sep 2019 16:16:23 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id 288C320BF9; Wed, 11 Sep 2019 12:16:22 -0400 (EDT) From: Scott Mayhew To: anna.schumaker@netapp.com, trond.myklebust@hammerspace.com Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 08/26] nfs: stash nfs_subversion reference into nfs_mount_info Date: Wed, 11 Sep 2019 12:16:03 -0400 Message-Id: <20190911161621.19832-9-smayhew@redhat.com> In-Reply-To: <20190911161621.19832-1-smayhew@redhat.com> References: <20190911161621.19832-1-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 11 Sep 2019 16:16:23 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Al Viro That will allow to get rid of passing those references around in quite a few places. Moreover, that will allow to merge xdev and remote file_system_type. Reviewed-by: David Howells Signed-off-by: Al Viro --- fs/nfs/internal.h | 1 + fs/nfs/namespace.c | 6 +++--- fs/nfs/nfs4super.c | 1 + fs/nfs/super.c | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index eeb54b45875c..0c42cf685d4b 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -150,6 +150,7 @@ struct nfs_mount_info { struct nfs_clone_mount *cloned; struct nfs_server *server; struct nfs_fh *mntfh; + struct nfs_subversion *nfs_mod; }; extern int nfs_mount(struct nfs_mount_request *info); diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 7c78e6956639..0d0587ed7d94 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c @@ -233,8 +233,8 @@ struct vfsmount *nfs_do_submount(struct dentry *dentry, struct nfs_fh *fh, .set_security = nfs_clone_sb_security, .cloned = &mountdata, .mntfh = fh, + .nfs_mod = NFS_SB(sb)->nfs_client->cl_nfs_mod, }; - struct nfs_subversion *nfs_mod = NFS_SB(sb)->nfs_client->cl_nfs_mod; struct nfs_server *server; struct vfsmount *mnt; char *page = (char *) __get_free_page(GFP_USER); @@ -243,8 +243,8 @@ struct vfsmount *nfs_do_submount(struct dentry *dentry, struct nfs_fh *fh, if (page == NULL) return ERR_PTR(-ENOMEM); - server = nfs_mod->rpc_ops->clone_server(NFS_SB(sb), fh, - fattr, authflavor); + server = mount_info.nfs_mod->rpc_ops->clone_server(NFS_SB(sb), fh, + fattr, authflavor); if (IS_ERR(server)) return ERR_CAST(server); diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 91ba1b6741dc..88d83cab8e9b 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -248,6 +248,7 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type, .fill_super = nfs_fill_super, .set_security = nfs_clone_sb_security, .cloned = data, + .nfs_mod = &nfs_v4, }; struct dentry *res; diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 7fc354207347..2a6b4e4b0a2d 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2736,6 +2736,7 @@ struct dentry *nfs_fs_mount(struct file_system_type *fs_type, mntroot = ERR_CAST(nfs_mod); goto out; } + mount_info.nfs_mod = nfs_mod; mntroot = nfs_mod->rpc_ops->try_mount(flags, dev_name, &mount_info, nfs_mod); -- 2.17.2