Skip to content

Commit 02e8fe1

Browse files
committed
svcrdma: Update synopsis of svc_rdma_build_read_chunk()
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>
1 parent fc20f19 commit 02e8fe1

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

net/sunrpc/xprtrdma/svc_rdma_rw.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@ static int svc_rdma_build_read_segment(struct svc_rqst *rqstp,
749749

750750
/**
751751
* svc_rdma_build_read_chunk - Build RDMA Read WQEs to pull one RDMA chunk
752-
* @rdma: controlling transport
753-
* @info: context for ongoing I/O
752+
* @rqstp: RPC transaction context
753+
* @head: context for ongoing I/O
754754
* @chunk: Read chunk to pull
755755
*
756756
* Return values:
@@ -759,18 +759,16 @@ static int svc_rdma_build_read_segment(struct svc_rqst *rqstp,
759759
* %-ENOMEM: allocating a local resources failed
760760
* %-EIO: a DMA mapping error occurred
761761
*/
762-
static int svc_rdma_build_read_chunk(struct svcxprt_rdma *rdma,
763-
struct svc_rdma_read_info *info,
762+
static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp,
763+
struct svc_rdma_recv_ctxt *head,
764764
const struct svc_rdma_chunk *chunk)
765765
{
766-
struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
767766
const struct svc_rdma_segment *segment;
768767
int ret;
769768

770769
ret = -EINVAL;
771770
pcl_for_each_segment(segment, chunk) {
772-
ret = svc_rdma_build_read_segment(info->ri_rqst,
773-
info->ri_readctxt, segment);
771+
ret = svc_rdma_build_read_segment(rqstp, head, segment);
774772
if (ret < 0)
775773
break;
776774
head->rc_readbytes += segment->rs_length;
@@ -861,7 +859,7 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
861859
return ret;
862860

863861
pcl_for_each_chunk(chunk, pcl) {
864-
ret = svc_rdma_build_read_chunk(rdma, info, chunk);
862+
ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
865863
if (ret < 0)
866864
return ret;
867865

@@ -920,7 +918,7 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma,
920918
int ret;
921919

922920
chunk = pcl_first_chunk(&head->rc_read_pcl);
923-
ret = svc_rdma_build_read_chunk(rdma, info, chunk);
921+
ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
924922
if (ret < 0)
925923
goto out;
926924

@@ -1025,7 +1023,8 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
10251023
int ret;
10261024

10271025
if (pcl_is_empty(pcl))
1028-
return svc_rdma_build_read_chunk(rdma, info, call_chunk);
1026+
return svc_rdma_build_read_chunk(info->ri_rqst, head,
1027+
call_chunk);
10291028

10301029
start = 0;
10311030
chunk = pcl_first_chunk(pcl);
@@ -1035,7 +1034,7 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
10351034
return ret;
10361035

10371036
pcl_for_each_chunk(chunk, pcl) {
1038-
ret = svc_rdma_build_read_chunk(rdma, info, chunk);
1037+
ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk);
10391038
if (ret < 0)
10401039
return ret;
10411040

0 commit comments

Comments
 (0)