Commit c7eb4feb authored by Chuck Lever's avatar Chuck Lever

svcrdma: Update synopsis of svc_rdma_read_chunk_range()

Since the RDMA Read I/O state is now contained in the recv_ctxt,
svc_rdma_build_read_chunk_range() 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 02e8fe1e
...@@ -951,9 +951,9 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma, ...@@ -951,9 +951,9 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma,
} }
/** /**
* svc_rdma_read_chunk_range - Build RDMA Read WQEs for portion of a chunk * svc_rdma_read_chunk_range - Build RDMA Read WRs for portion of a chunk
* @rdma: controlling transport * @rqstp: RPC transaction context
* @info: context for RDMA Reads * @head: context for ongoing I/O
* @chunk: parsed Call chunk to pull * @chunk: parsed Call chunk to pull
* @offset: offset of region to pull * @offset: offset of region to pull
* @length: length of region to pull * @length: length of region to pull
...@@ -965,12 +965,11 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma, ...@@ -965,12 +965,11 @@ static int svc_rdma_read_data_item(struct svcxprt_rdma *rdma,
* %-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_chunk_range(struct svcxprt_rdma *rdma, static int svc_rdma_read_chunk_range(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,
unsigned int offset, unsigned int length) unsigned int offset, unsigned int length)
{ {
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;
...@@ -987,8 +986,7 @@ static int svc_rdma_read_chunk_range(struct svcxprt_rdma *rdma, ...@@ -987,8 +986,7 @@ static int svc_rdma_read_chunk_range(struct svcxprt_rdma *rdma,
dummy.rs_length = min_t(u32, length, segment->rs_length) - offset; dummy.rs_length = min_t(u32, length, segment->rs_length) - offset;
dummy.rs_offset = segment->rs_offset + offset; dummy.rs_offset = segment->rs_offset + offset;
ret = svc_rdma_build_read_segment(info->ri_rqst, ret = svc_rdma_build_read_segment(rqstp, head, &dummy);
info->ri_readctxt, &dummy);
if (ret < 0) if (ret < 0)
break; break;
...@@ -1029,7 +1027,8 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, ...@@ -1029,7 +1027,8 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma,
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(rdma, info, call_chunk, start, length); ret = svc_rdma_read_chunk_range(info->ri_rqst, head, call_chunk,
start, length);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1044,15 +1043,16 @@ static int svc_rdma_read_call_chunk(struct svcxprt_rdma *rdma, ...@@ -1044,15 +1043,16 @@ 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(rdma, info, call_chunk, ret = svc_rdma_read_chunk_range(info->ri_rqst, head,
start, length); call_chunk, 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(rdma, info, call_chunk, start, length); return svc_rdma_read_chunk_range(info->ri_rqst, head, call_chunk,
start, length);
} }
/** /**
......
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