diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2021-09-30 17:06:21 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2021-10-02 16:10:01 -0400 |
commit | dae9a6cab8009e526570e7477ce858dcdfeb256e (patch) | |
tree | c21c6f7c40a317463da96e10a98e05e9e5313090 /net/sunrpc/svc.c | |
parent | f49b68ddc9d7dddf1530312108a648dd815a2f30 (diff) | |
download | linux-dae9a6cab8009e526570e7477ce858dcdfeb256e.tar.gz linux-dae9a6cab8009e526570e7477ce858dcdfeb256e.tar.bz2 linux-dae9a6cab8009e526570e7477ce858dcdfeb256e.zip |
NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment()
Refactor.
Now that the NFSv2 and NFSv3 XDR decoders have been converted to
use xdr_streams, the WRITE decoder functions can use
xdr_stream_subsegment() to extract the WRITE payload into its own
xdr_buf, just as the NFSv4 WRITE XDR decoder currently does.
That makes it possible to pass the first kvec, pages array + length,
page_base, and total payload length via a single function parameter.
The payload's page_base is not yet assigned or used, but will be in
subsequent patches.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r-- | net/sunrpc/svc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index a3bbe5ce4570..08ca797bb8a4 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1676,16 +1676,17 @@ EXPORT_SYMBOL_GPL(svc_encode_result_payload); /** * svc_fill_write_vector - Construct data argument for VFS write call * @rqstp: svc_rqst to operate on - * @pages: list of pages containing data payload - * @first: buffer containing first section of write payload - * @total: total number of bytes of write payload + * @payload: xdr_buf containing only the write data payload * * Fills in rqstp::rq_vec, and returns the number of elements. */ -unsigned int svc_fill_write_vector(struct svc_rqst *rqstp, struct page **pages, - struct kvec *first, size_t total) +unsigned int svc_fill_write_vector(struct svc_rqst *rqstp, + struct xdr_buf *payload) { + struct page **pages = payload->pages; + struct kvec *first = payload->head; struct kvec *vec = rqstp->rq_vec; + size_t total = payload->len; unsigned int i; /* Some types of transport can present the write payload |