Skip to content

Commit 6518204

Browse files
committed
svcrdma: Update synopsis of svc_rdma_copy_inline_range()
Since the RDMA Read I/O state is now contained in the recv_ctxt, svc_rdma_copy_inline_range() 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 6e4b9b8 commit 6518204

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

net/sunrpc/xprtrdma/svc_rdma_rw.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,8 @@ static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp,
778778

779779
/**
780780
* svc_rdma_copy_inline_range - Copy part of the inline content into pages
781-
* @info: context for RDMA Reads
781+
* @rqstp: RPC transaction context
782+
* @head: context for ongoing I/O
782783
* @offset: offset into the Receive buffer of region to copy
783784
* @remaining: length of region to copy
784785
*
@@ -791,13 +792,12 @@ static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp,
791792
* %0: Inline content was successfully copied
792793
* %-EINVAL: offset or length was incorrect
793794
*/
794-
static int svc_rdma_copy_inline_range(struct svc_rdma_read_info *info,
795+
static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
796+
struct svc_rdma_recv_ctxt *head,
795797
unsigned int offset,
796798
unsigned int remaining)
797799
{
798-
struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
799800
unsigned char *dst, *src = head->rc_recv_buf;
800-
struct svc_rqst *rqstp = info->ri_rqst;
801801
unsigned int page_no, numpages;
802802

803803
numpages = PAGE_ALIGN(head->rc_pageoff + remaining) >> PAGE_SHIFT;
@@ -846,15 +846,16 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
846846
{
847847
struct svc_rdma_recv_ctxt *head = info->ri_readctxt;
848848
const struct svc_rdma_pcl *pcl = &head->rc_read_pcl;
849-
struct xdr_buf *buf = &info->ri_rqst->rq_arg;
849+
struct svc_rqst *rqstp = info->ri_rqst;
850+
struct xdr_buf *buf = &rqstp->rq_arg;
850851
struct svc_rdma_chunk *chunk, *next;
851852
unsigned int start, length;
852853
int ret;
853854

854855
start = 0;
855856
chunk = pcl_first_chunk(pcl);
856857
length = chunk->ch_position;
857-
ret = svc_rdma_copy_inline_range(info, start, length);
858+
ret = svc_rdma_copy_inline_range(rqstp, head, start, length);
858859
if (ret < 0)
859860
return ret;
860861

@@ -869,14 +870,14 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma,
869870

870871
start += length;
871872
length = next->ch_position - head->rc_readbytes;
872-
ret = svc_rdma_copy_inline_range(info, start, length);
873+
ret = svc_rdma_copy_inline_range(rqstp, head, start, length);
873874
if (ret < 0)
874875
return ret;
875876
}
876877

877878
start += length;
878879
length = head->rc_byte_len - start;
879-
ret = svc_rdma_copy_inline_range(info, start, length);
880+
ret = svc_rdma_copy_inline_range(rqstp, head, start, length);
880881
if (ret < 0)
881882
return ret;
882883

0 commit comments

Comments
 (0)