Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp726020ybe; Fri, 13 Sep 2019 05:23:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwOE+PXqHGcGPz7iL3vXR6RkKBTAcO/z8eF/TDflI0waVJPBAEcFK0hTvLCV0WOHAK0N9O X-Received: by 2002:a17:906:4ac1:: with SMTP id u1mr38553209ejt.293.1568377428511; Fri, 13 Sep 2019 05:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568377428; cv=none; d=google.com; s=arc-20160816; b=qhCBDBNTl2DZvOZXCfA8zLKdkbep9BqFKZ7xG+1PT0Dl47bXhbJTMOzr+1KO2TjUHd uUvCFU9ELwBT8GXQ7HHcNWV0vDf/XALhSL3p+NSJDcl0JR6cvydblmynxZLHgSnqyqwE E3k3Ebh1Ngn2BiadHBQl4CJszTQNSY8rYiI/X0yqm97A1jMYjEzAZq+dLtZzRBw41kBr WgNQ49zGLrzS+ndFRiTJ25QnISOpwTRIgkY3gA6fegL+PwI6f+7ZEn5FLrL5lKwZypGQ vwmEJg08SJCjn9RAjRx6VXbFVFJrJRD225zuJnzgYYJV8CBcVwqciG1U3+/Yd6TtNCne u3ew== 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=WbfWagxnj9GbBiXUA2p5hGBSHqJpr2e9cieEK5kmHjGPKo96if+h2PFX0WgdqJTC+X kWhxQdAAgqnBilOaO24R93p2Ujxr/MuwDysFbEt8NXIjVe6V8i+MAsRDJnaIGjXxtH5R LMY6l6gQtv/eVDNgFUR/tJ+RZKys/Q+6I1ukTa/lJrrCv3Ekk0o/GjW3IUvhBMl7cxUU P1Z26dbG3tHsIRvmq0pwHzegf2y2SrzItYZjD65Y3oaR2Fy9nu7K9XWef9SPNh+K2Bau zg/6Rl6xQLXT4Hh48DqITCnrCs1KaXsh/MqhJxy3XdQ43ZJfKkUgukMSCehleXWEOXiq nEGw== 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 d23si16965122edb.55.2019.09.13.05.23.23; Fri, 13 Sep 2019 05:23:48 -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 S2388413AbfIMMUK (ORCPT + 99 others); Fri, 13 Sep 2019 08:20:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43464 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728666AbfIMMRu (ORCPT ); Fri, 13 Sep 2019 08:17:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D47E8C053FDF; Fri, 13 Sep 2019 12:17:49 +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 B6719608AB; Fri, 13 Sep 2019 12:17:49 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id C190F20BF9; Fri, 13 Sep 2019 08:17:48 -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 v4 08/26] nfs: stash nfs_subversion reference into nfs_mount_info Date: Fri, 13 Sep 2019 08:17:30 -0400 Message-Id: <20190913121748.25391-9-smayhew@redhat.com> In-Reply-To: <20190913121748.25391-1-smayhew@redhat.com> References: <20190913121748.25391-1-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 13 Sep 2019 12:17:49 +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