public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: linux-nfs@vger.kernel.org
Cc: Jeff Layton <jlayton@kernel.org>,
	Chuck Lever <chuck.lever@oracle.com>,
	Trond Myklebust <trondmy@hammerspace.com>,
	NeilBrown <neilb@suse.de>,
	snitzer@hammerspace.com
Subject: [PATCH v7 01/20] nfs: pass nfs_client to nfs_initiate_pgio
Date: Mon, 24 Jun 2024 12:27:22 -0400	[thread overview]
Message-ID: <20240624162741.68216-2-snitzer@kernel.org> (raw)
In-Reply-To: <20240624162741.68216-1-snitzer@kernel.org>

From: Weston Andros Adamson <dros@primarydata.com>

The nfs_client is needed for localio support. Otherwise it won't be
possible to disable localio if it is attempted but fails.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Lance Shelton <lance.shelton@hammerspace.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
 fs/nfs/filelayout/filelayout.c         |  4 ++--
 fs/nfs/flexfilelayout/flexfilelayout.c |  6 ++++--
 fs/nfs/internal.h                      |  5 +++--
 fs/nfs/pagelist.c                      | 10 ++++++----
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index 29d84dc66ca3..43e16e9e0176 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -486,7 +486,7 @@ filelayout_read_pagelist(struct nfs_pgio_header *hdr)
 	hdr->mds_offset = offset;
 
 	/* Perform an asynchronous read to ds */
-	nfs_initiate_pgio(ds_clnt, hdr, hdr->cred,
+	nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, hdr->cred,
 			  NFS_PROTO(hdr->inode), &filelayout_read_call_ops,
 			  0, RPC_TASK_SOFTCONN);
 	return PNFS_ATTEMPTED;
@@ -528,7 +528,7 @@ filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
 	hdr->args.offset = filelayout_get_dserver_offset(lseg, offset);
 
 	/* Perform an asynchronous write */
-	nfs_initiate_pgio(ds_clnt, hdr, hdr->cred,
+	nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, hdr->cred,
 			  NFS_PROTO(hdr->inode), &filelayout_write_call_ops,
 			  sync, RPC_TASK_SOFTCONN);
 	return PNFS_ATTEMPTED;
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 24188af56d5b..327f1a5c9fbe 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1803,7 +1803,8 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
 	hdr->mds_offset = offset;
 
 	/* Perform an asynchronous read to ds */
-	nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops,
+	nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, ds_cred,
+			  ds->ds_clp->rpc_ops,
 			  vers == 3 ? &ff_layout_read_call_ops_v3 :
 				      &ff_layout_read_call_ops_v4,
 			  0, RPC_TASK_SOFTCONN);
@@ -1871,7 +1872,8 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
 	hdr->args.offset = offset;
 
 	/* Perform an asynchronous write */
-	nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops,
+	nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, ds_cred,
+			  ds->ds_clp->rpc_ops,
 			  vers == 3 ? &ff_layout_write_call_ops_v3 :
 				      &ff_layout_write_call_ops_v4,
 			  sync, RPC_TASK_SOFTCONN);
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 9f0f4534744b..a9c0c29f7804 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -306,8 +306,9 @@ extern const struct nfs_pageio_ops nfs_pgio_rw_ops;
 struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *);
 void nfs_pgio_header_free(struct nfs_pgio_header *);
 int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *);
-int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr,
-		      const struct cred *cred, const struct nfs_rpc_ops *rpc_ops,
+int nfs_initiate_pgio(struct nfs_client *clp, struct rpc_clnt *rpc_clnt,
+		      struct nfs_pgio_header *hdr, const struct cred *cred,
+		      const struct nfs_rpc_ops *rpc_ops,
 		      const struct rpc_call_ops *call_ops, int how, int flags);
 void nfs_free_request(struct nfs_page *req);
 struct nfs_pgio_mirror *
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 6efb5068c116..d9b795c538cd 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -844,8 +844,9 @@ static void nfs_pgio_prepare(struct rpc_task *task, void *calldata)
 		rpc_exit(task, err);
 }
 
-int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr,
-		      const struct cred *cred, const struct nfs_rpc_ops *rpc_ops,
+int nfs_initiate_pgio(struct nfs_client *clp, struct rpc_clnt *rpc_clnt,
+		      struct nfs_pgio_header *hdr, const struct cred *cred,
+		      const struct nfs_rpc_ops *rpc_ops,
 		      const struct rpc_call_ops *call_ops, int how, int flags)
 {
 	struct rpc_task *task;
@@ -855,7 +856,7 @@ int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr,
 		.rpc_cred = cred,
 	};
 	struct rpc_task_setup task_setup_data = {
-		.rpc_client = clnt,
+		.rpc_client = rpc_clnt,
 		.task = &hdr->task,
 		.rpc_message = &msg,
 		.callback_ops = call_ops,
@@ -1070,7 +1071,8 @@ static int nfs_generic_pg_pgios(struct nfs_pageio_descriptor *desc)
 	if (ret == 0) {
 		if (NFS_SERVER(hdr->inode)->nfs_client->cl_minorversion)
 			task_flags = RPC_TASK_MOVEABLE;
-		ret = nfs_initiate_pgio(NFS_CLIENT(hdr->inode),
+		ret = nfs_initiate_pgio(NFS_SERVER(hdr->inode)->nfs_client,
+					NFS_CLIENT(hdr->inode),
 					hdr,
 					hdr->cred,
 					NFS_PROTO(hdr->inode),
-- 
2.44.0


  reply	other threads:[~2024-06-24 16:27 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 16:27 [PATCH v7 00/20] nfs/nfsd: add support for localio Mike Snitzer
2024-06-24 16:27 ` Mike Snitzer [this message]
2024-06-24 16:27 ` [PATCH v7 02/20] nfs: pass descriptor thru nfs_initiate_pgio path Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 03/20] nfs: pass struct file to nfs_init_pgio and nfs_init_commit Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 04/20] sunrpc: add rpcauth_map_to_svc_cred_local Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 05/20] nfs_common: add NFS LOCALIO auxiliary protocol enablement Mike Snitzer
2024-06-25 23:33   ` NeilBrown
2024-06-26 16:50     ` Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 06/20] nfs/nfsd: add "localio" support Mike Snitzer
2024-06-24 18:26   ` Chuck Lever
2024-06-25  4:57     ` Mike Snitzer
2024-06-25 13:59       ` Chuck Lever
2024-06-24 16:27 ` [PATCH v7 07/20] nfsd/localio: manage netns reference in nfsd_open_local_fh Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 08/20] NFS: Enable localio for non-pNFS I/O Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 09/20] pnfs/flexfiles: Enable localio for flexfiles I/O Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 10/20] nfs/localio: use dedicated workqueues for filesystem read and write Mike Snitzer
2024-06-25 23:15   ` NeilBrown
2024-06-24 16:27 ` [PATCH v7 11/20] nfs/nfsd: factor out {encode,decode}_opaque_fixed to nfs_xdr.h Mike Snitzer
2024-06-24 18:28   ` Chuck Lever
2024-06-24 16:27 ` [PATCH v7 12/20] SUNRPC: remove call_allocate() BUG_ON if p_arglen=0 to allow RPC with void arg Mike Snitzer
2024-06-25 23:19   ` NeilBrown
2024-06-26 16:53     ` Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 13/20] nfs: implement client support for NFS_LOCALIO_PROGRAM Mike Snitzer
2024-06-25 23:21   ` NeilBrown
2024-06-26 16:45     ` Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 14/20] nfsd: implement server " Mike Snitzer
2024-06-24 18:45   ` Chuck Lever
2024-06-25 23:23   ` NeilBrown
2024-06-26 16:27     ` Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 15/20] SUNRPC: replace program list with program array Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 16/20] nfsd: prepare to use SRCU to dereference nn->nfsd_serv Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 17/20] nfsd: " Mike Snitzer
2024-06-25 12:43   ` Jeff Layton
2024-06-25 23:29     ` NeilBrown
2024-06-26 16:49       ` Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 18/20] nfsd/localio: use SRCU to dereference nn->nfsd_serv in nfsd_open_local_fh Mike Snitzer
2024-06-24 16:27 ` [PATCH v7 19/20] nfs: add Documentation/filesystems/nfs/localio.rst Mike Snitzer
2024-06-25 11:59   ` Jeff Layton
2024-06-24 16:27 ` [PATCH v7 20/20] nfs/nfsd: add Kconfig options to allow localio to be enabled Mike Snitzer
2024-06-25 12:49 ` [PATCH v7 00/20] nfs/nfsd: add support for localio Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240624162741.68216-2-snitzer@kernel.org \
    --to=snitzer@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=snitzer@hammerspace.com \
    --cc=trondmy@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox