Skip to content

Commit 740a3c8

Browse files
committed
svcrdma: Update synopsis of svc_rdma_read_multiple_chunks()
Since the RDMA Read I/O state is now contained in the recv_ctxt, svc_rdma_read_multiple_chunks() can use that recv_ctxt to derive the read_info 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>
1 parent 6518204 commit 740a3c8

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

net/sunrpc/xprtrdma/svc_rdma_rw.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,8 @@ static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
828828

829829
/**
830830
* svc_rdma_read_multiple_chunks - Construct RDMA Reads to pull data item Read chunks
831-
* @rdma: controlling transport
832-
* @info: context for RDMA Reads
831+
* @rqstp: RPC transaction context
832+
* @head: context for ongoing I/O
833833
*
834834
* The chunk data lands in rqstp->rq_arg as a series of contiguous pages,
835835
* like an incoming TCP call.
@@ -841,12 +841,11 @@ static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
841841
* %-ENOTCONN: posting failed (connection is lost),
842842
* %-EIO: rdma_rw initialization failed (DMA mapping, etc).
843843
*/
844-
static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
845-
struct svc_rdma_read_info *info)
844+
static noinline int
845+
svc_rdma_read_multiple_chunks(struct svc_rqst *rqstp,
846+
struct svc_rdma_recv_ctxt *head)
846847
{
847-
struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
848848
const struct svc_rdma_pcl *pcl = &head->rc_read_pcl;
849-
struct svc_rqst *rqstp = info->ri_rqst;
850849
struct xdr_buf *buf = &rqstp->rq_arg;
851850
struct svc_rdma_chunk *chunk, *next;
852851
unsigned int start, length;
@@ -860,7 +859,7 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
860859
return ret;
861860

862861
pcl_for_each_chunk(chunk, pcl) {
863-
ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
862+
ret = svc_rdma_build_read_chunk(rqstp, head, chunk);
864863
if (ret < 0)
865864
return ret;
866865

@@ -884,9 +883,9 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
884883
buf->len += head->rc_readbytes;
885884
buf->buflen += head->rc_readbytes;
886885

887-
buf->head[0].iov_base = page_address(info->ri_rqst->rq_pages[0]);
886+
buf->head[0].iov_base = page_address(rqstp->rq_pages[0]);
888887
buf->head[0].iov_len = min_t(size_t, PAGE_SIZE, head->rc_readbytes);
889-
buf->pages = &info->ri_rqst->rq_pages[1];
888+
buf->pages = &rqstp->rq_pages[1];
890889
buf->page_len = head->rc_readbytes - buf->head[0].iov_len;
891890
return 0;
892891
}
@@ -1143,7 +1142,7 @@ int svc_rdma_process_read_list(struct svcxprt_rdma *rdma,
11431142
if (head->rc_read_pcl.cl_count == 1)
11441143
ret = svc_rdma_read_data_item(rqstp, head);
11451144
else
1146-
ret = svc_rdma_read_multiple_chunks(rdma, info);
1145+
ret = svc_rdma_read_multiple_chunks(rqstp, head);
11471146
} else
11481147
ret = svc_rdma_read_special(rdma, info);
11491148
if (ret < 0)

0 commit comments

Comments
 (0)