Commit 23bab3b2 authored by Chuck Lever's avatar Chuck Lever

svcrdma: Update the synopsis of svc_rdma_read_call_chunk()

Since the RDMA Read I/O state is now contained in the recv_ctxt,
svc_rdma_read_call_chunk() 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: default avatarChuck Lever <chuck.lever@oracle.com>
parent 740a3c89
...@@ -998,8 +998,8 @@ static int svc_rdma_read_chunk_range(struct svc_rqst *rqstp, ...@@ -998,8 +998,8 @@ static int svc_rdma_read_chunk_range(struct svc_rqst *rqstp,
/** /**
* svc_rdma_read_call_chunk - Build RDMA Read WQEs to pull a Long Message * svc_rdma_read_call_chunk - Build RDMA Read WQEs to pull a Long Message
* @rdma: controlling transport * @rqstp: RPC transaction context
* @info: context for RDMA Reads * @head: context for ongoing I/O
* *
* Return values: * Return values:
* %0: RDMA Read WQEs were successfully built * %0: RDMA Read WQEs were successfully built
...@@ -1008,10 +1008,9 @@ static int svc_rdma_read_chunk_range(struct svc_rqst *rqstp, ...@@ -1008,10 +1008,9 @@ static int svc_rdma_read_chunk_range(struct svc_rqst *rqstp,
* %-ENOTCONN: posting failed (connection is lost), * %-ENOTCONN: posting failed (connection is lost),
* %-EIO: rdma_rw initialization failed (DMA mapping, etc). * %-EIO: rdma_rw initialization failed (DMA mapping, etc).
*/ */
static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, static int svc_rdma_read_call_chunk(struct svc_rqst *rqstp,
struct svc_rdma_read_info *info) struct svc_rdma_recv_ctxt *head)
{ {
struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
const struct svc_rdma_chunk *call_chunk = const struct svc_rdma_chunk *call_chunk =
pcl_first_chunk(&head->rc_call_pcl); pcl_first_chunk(&head->rc_call_pcl);
const struct svc_rdma_pcl *pcl = &head->rc_read_pcl; const struct svc_rdma_pcl *pcl = &head->rc_read_pcl;
...@@ -1020,19 +1019,18 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, ...@@ -1020,19 +1019,18 @@ 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(info->ri_rqst, head, return svc_rdma_build_read_chunk(rqstp, head, call_chunk);
call_chunk);
start = 0; start = 0;
chunk = pcl_first_chunk(pcl); chunk = pcl_first_chunk(pcl);
length = chunk->ch_position; length = chunk->ch_position;
ret = svc_rdma_read_chunk_range(info->ri_rqst, head, call_chunk, ret = svc_rdma_read_chunk_range(rqstp, head, call_chunk,
start, length); start, length);
if (ret < 0) if (ret < 0)
return ret; return ret;
pcl_for_each_chunk(chunk, pcl) { pcl_for_each_chunk(chunk, pcl) {
ret = svc_rdma_build_read_chunk(info->ri_rqst, head, chunk); ret = svc_rdma_build_read_chunk(rqstp, head, chunk);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1042,15 +1040,15 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, ...@@ -1042,15 +1040,15 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
start += length; start += length;
length = next->ch_position - head->rc_readbytes; length = next->ch_position - head->rc_readbytes;
ret = svc_rdma_read_chunk_range(info->ri_rqst, head, ret = svc_rdma_read_chunk_range(rqstp, head, call_chunk,
call_chunk, start, length); start, length);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
start += length; start += length;
length = call_chunk->ch_length - start; length = call_chunk->ch_length - start;
return svc_rdma_read_chunk_range(info->ri_rqst, head, call_chunk, return svc_rdma_read_chunk_range(rqstp, head, call_chunk,
start, length); start, length);
} }
...@@ -1080,7 +1078,7 @@ static noinline int svc_rdma_read_special(struct svcxprt_rdma *rdma, ...@@ -1080,7 +1078,7 @@ static noinline int svc_rdma_read_special(struct svcxprt_rdma *rdma,
struct xdr_buf *buf = &info->ri_rqst->rq_arg; struct xdr_buf *buf = &info->ri_rqst->rq_arg;
int ret; int ret;
ret = svc_rdma_read_call_chunk(rdma, info); ret = svc_rdma_read_call_chunk(info->ri_rqst, info->ri_readctxt);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
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