diff mbox series

[v1,13/21] svcrdma: Update synopsis of svc_rdma_build_read_chunk()

Message ID 170170186189.54779.4397249414679111475.stgit@bazille.1015granger.net (mailing list archive)
State New, archived
Headers show
Series svc_rdma_read_info clean ups | expand

Commit Message

Chuck Lever Dec. 4, 2023, 2:57 p.m. UTC
From: Chuck Lever <chuck.lever@oracle.com>

Since the RDMA Read I/O state is now contained in the recv_ctxt,
svc_rdma_build_read_chunk() can use that recv_ctxt to derive that
information rather than the other way around. This removes another
usage of the ri_readctxt field, enabling its removal in a
subsequent patch.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/svc_rdma_rw.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c
index c2d0e4bb454e..b10341cd1df2 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_rw.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c
@@ -749,8 +749,8 @@  static int svc_rdma_build_read_segment(struct svc_rqst *rqstp,
 
 /**
  * svc_rdma_build_read_chunk - Build RDMA Read WQEs to pull one RDMA chunk
- * @rdma: controlling transport
- * @info: context for ongoing I/O
+ * @rqstp: RPC transaction context
+ * @head: context for ongoing I/O
  * @chunk: Read chunk to pull
  *
  * Return values:
@@ -759,18 +759,16 @@  static int svc_rdma_build_read_segment(struct svc_rqst *rqstp,
  *   %-ENOMEM: allocating a local resources failed
  *   %-EIO: a DMA mapping error occurred
  */
-static int svc_rdma_build_read_chunk(struct svcxprt_rdma *rdma,
-				     struct svc_rdma_read_info *info,
+static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp,
+				     struct svc_rdma_recv_ctxt *head,
 				     const struct svc_rdma_chunk *chunk)
 {
-	struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
 	const struct svc_rdma_segment *segment;
 	int ret;
 
 	ret = -EINVAL;
 	pcl_for_each_segment(segment, chunk) {
-		ret = svc_rdma_build_read_segment(info->ri_rqst,
-						  info->ri_readctxt, segment);
+		ret = svc_rdma_build_read_segment(rqstp, head, segment);
 		if (ret < 0)
 			break;
 		head->rc_readbytes += segment->rs_length;
@@ -861,7 +859,7 @@  static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
 		return ret;
 
 	pcl_for_each_chunk(chunk, pcl) {
-		ret = svc_rdma_build_read_chunk(rdma, info, chunk);
+		ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
 		if (ret < 0)
 			return ret;
 
@@ -920,7 +918,7 @@  static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma,
 	int ret;
 
 	chunk = pcl_first_chunk(&head->rc_read_pcl);
-	ret = svc_rdma_build_read_chunk(rdma, info, chunk);
+	ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
 	if (ret < 0)
 		goto out;
 
@@ -1025,7 +1023,8 @@  static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
 	int ret;
 
 	if (pcl_is_empty(pcl))
-		return svc_rdma_build_read_chunk(rdma, info, call_chunk);
+		return svc_rdma_build_read_chunk(info->ri_rqst, head,
+						 call_chunk);
 
 	start = 0;
 	chunk = pcl_first_chunk(pcl);
@@ -1035,7 +1034,7 @@  static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
 		return ret;
 
 	pcl_for_each_chunk(chunk, pcl) {
-		ret = svc_rdma_build_read_chunk(rdma, info, chunk);
+		ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
 		if (ret < 0)
 			return ret;