Commit 02e8fe1e authored by Chuck Lever's avatar Chuck Lever

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: default avatarChuck Lever <chuck.lever@oracle.com>
parent fc20f19b
...@@ -749,8 +749,8 @@ static int svc_rdma_build_read_segment(struct svc_rqst *rqstp, ...@@ -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 * svc_rdma_build_read_chunk - Build RDMA Read WQEs to pull one RDMA chunk
* @rdma: controlling transport * @rqstp: RPC transaction context
* @info: context for ongoing I/O * @head: context for ongoing I/O
* @chunk: Read chunk to pull * @chunk: Read chunk to pull
* *
* Return values: * Return values:
...@@ -759,18 +759,16 @@ static int svc_rdma_build_read_segment(struct svc_rqst *rqstp, ...@@ -759,18 +759,16 @@ static int svc_rdma_build_read_segment(struct svc_rqst *rqstp,
* %-ENOMEM: allocating a local resources failed * %-ENOMEM: allocating a local resources failed
* %-EIO: a DMA mapping error occurred * %-EIO: a DMA mapping error occurred
*/ */
static int svc_rdma_build_read_chunk(struct svcxprt_rdma *rdma, static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp,
struct svc_rdma_read_info *info, struct svc_rdma_recv_ctxt *head,
const struct svc_rdma_chunk *chunk) const struct svc_rdma_chunk *chunk)
{ {
struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
const struct svc_rdma_segment *segment; const struct svc_rdma_segment *segment;
int ret; int ret;
ret = -EINVAL; ret = -EINVAL;
pcl_for_each_segment(segment, chunk) { pcl_for_each_segment(segment, chunk) {
ret = svc_rdma_build_read_segment(info->ri_rqst, ret = svc_rdma_build_read_segment(rqstp, head, segment);
info->ri_readctxt, segment);
if (ret < 0) if (ret < 0)
break; break;
head->rc_readbytes += segment->rs_length; head->rc_readbytes += segment->rs_length;
...@@ -861,7 +859,7 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma, ...@@ -861,7 +859,7 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
return ret; return ret;
pcl_for_each_chunk(chunk, pcl) { 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) if (ret < 0)
return ret; return ret;
...@@ -920,7 +918,7 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma, ...@@ -920,7 +918,7 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma,
int ret; int ret;
chunk = pcl_first_chunk(&head->rc_read_pcl); 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) if (ret < 0)
goto out; goto out;
...@@ -1025,7 +1023,8 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, ...@@ -1025,7 +1023,8 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
int ret; int ret;
if (pcl_is_empty(pcl)) 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; start = 0;
chunk = pcl_first_chunk(pcl); chunk = pcl_first_chunk(pcl);
...@@ -1035,7 +1034,7 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, ...@@ -1035,7 +1034,7 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
return ret; return ret;
pcl_for_each_chunk(chunk, pcl) { 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) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment