Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2479726ybe; Tue, 3 Sep 2019 13:35:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV3no9uV5w7Jp7vCi3it8S2Z1qE9kmJZgfURR2VAurr3UpJTD4JhVGdpsLsA9EGMei90GK X-Received: by 2002:a63:7e1d:: with SMTP id z29mr32057596pgc.346.1567542905787; Tue, 03 Sep 2019 13:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567542905; cv=none; d=google.com; s=arc-20160816; b=vUfJ4PhMFZQgy82bTvuqckPYMoIW4xq2raLaxQmH/0/AdtbOqfOCQMTykFI7fJs4pq fSWSLBwAMv26QC3CRskkLkf5Jnb857kIjKiqoVcKmhMtOmvX1ysGSUmVv8hLe2kAj+OX 8WOlZLKgSWJ/Jx7lUojaCqco9U5SR5TIrFAYk0p2Y0fzWhFs3SuLhF2kVspKJbSvk2A/ lOlA/AAjYTxQXzS94qyxKQPocAxOgf81T+i2Ao5KfPjSmT+ZjGTreG4nFzTqMoBn5FXa PcoF/Mo3vdd/I/G4T4W5SGORXqEegypDFcad3q8hlF3aX7GFqpnQDBrJoxS7AaIx1c82 1O9A== 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=j7Wpz0kdNOEAh2n79zSqfNPiFaJsdslg5yRfvKW1Gt4CQUtRlY9j1HvPzlgiUAmB2n NQ8uMjoQHvOAZD7308HxNmmtNJn2wirVaSaWKmtX/FqDGVfiPFv8bmS9xhPU5lPbmHTl mUZ5pHMRUATmALdKevdv8W8SCi/iEIab955My5xxkkqAWSY6XzEPehstNbFrzhxEiSt3 7ZzeIAAYMqclU0cjo6U5n7WJyuGSLStHF1a8+crWfFXDG4LFxi4yy4i2S5rDHuArXSUH P5wRxCZX/wTUTf356D2Hzfjethvc8obAktoAYsyDmfDS2zgd9oHAA7zM4AWwU8Sh+nZJ IGOA== 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 w66si18735205pfw.65.2019.09.03.13.34.52; Tue, 03 Sep 2019 13:35:05 -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 S1727692AbfICUeH (ORCPT + 99 others); Tue, 3 Sep 2019 16:34:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35548 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbfICUcR (ORCPT ); Tue, 3 Sep 2019 16:32:17 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4504F81F11; Tue, 3 Sep 2019 20:32:17 +0000 (UTC) Received: from coeurl.usersys.redhat.com (ovpn-121-35.rdu2.redhat.com [10.10.121.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24C6F19C78; Tue, 3 Sep 2019 20:32:17 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id 9046A20C2E; Tue, 3 Sep 2019 16:32:15 -0400 (EDT) From: Scott Mayhew To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.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 v2 08/26] nfs: stash nfs_subversion reference into nfs_mount_info Date: Tue, 3 Sep 2019 16:31:57 -0400 Message-Id: <20190903203215.9157-9-smayhew@redhat.com> In-Reply-To: <20190903203215.9157-1-smayhew@redhat.com> References: <20190903203215.9157-1-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 03 Sep 2019 20:32:17 +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