From: Chuck Lever <chuck.lever@oracle.com>
To: Bruce Fields <bfields@fieldses.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH 04/20] SUNRPC: Rename svc_encode_read_payload()
Date: Wed, 28 Oct 2020 09:16:11 -0400 [thread overview]
Message-ID: <D74674A4-7296-4DB6-B66B-119150D1FC71@oracle.com> (raw)
In-Reply-To: <20201027205327.GC4697@fieldses.org>
> On Oct 27, 2020, at 4:53 PM, bfields@fieldses.org wrote:
>
> On Mon, Oct 26, 2020 at 02:54:14PM -0400, Chuck Lever wrote:
>> Clean up: "result payload" is a less confusing name for these
>> payloads. "READ payload" reflects only the NFS usage.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>> fs/nfsd/nfs4xdr.c | 2 +-
>> include/linux/sunrpc/svc.h | 6 +++---
>> include/linux/sunrpc/svc_rdma.h | 4 ++--
>> include/linux/sunrpc/svc_xprt.h | 4 ++--
>> net/sunrpc/svc.c | 11 ++++++-----
>> net/sunrpc/svcsock.c | 8 ++++----
>> net/sunrpc/xprtrdma/svc_rdma_sendto.c | 8 ++++----
>> net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 +-
>> 8 files changed, 23 insertions(+), 22 deletions(-)
>>
>> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
>> index 833a2c64dfe8..7e24fb3ca36e 100644
>> --- a/fs/nfsd/nfs4xdr.c
>> +++ b/fs/nfsd/nfs4xdr.c
>> @@ -3829,7 +3829,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
>> read->rd_length = maxcount;
>> if (nfserr)
>> return nfserr;
>> - if (svc_encode_read_payload(resp->rqstp, starting_len + 8, maxcount))
>> + if (svc_encode_result_payload(resp->rqstp, starting_len + 8, maxcount))
>> return nfserr_io;
>
> Why does this call check for an error return while the
> svc_encode_result_payload() calls in the next patch don't?
Very likely an oversight. I will ensure the next patch
properly incorporates return code checking.
>
> --b.
>
>> xdr_truncate_encode(xdr, starting_len + 8 + xdr_align_size(maxcount));
>>
>> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
>> index 386628b36bc7..c220b734fa69 100644
>> --- a/include/linux/sunrpc/svc.h
>> +++ b/include/linux/sunrpc/svc.h
>> @@ -519,9 +519,9 @@ void svc_wake_up(struct svc_serv *);
>> void svc_reserve(struct svc_rqst *rqstp, int space);
>> struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
>> char * svc_print_addr(struct svc_rqst *, char *, size_t);
>> -int svc_encode_read_payload(struct svc_rqst *rqstp,
>> - unsigned int offset,
>> - unsigned int length);
>> +int svc_encode_result_payload(struct svc_rqst *rqstp,
>> + unsigned int offset,
>> + unsigned int length);
>> unsigned int svc_fill_write_vector(struct svc_rqst *rqstp,
>> struct page **pages,
>> struct kvec *first, size_t total);
>> diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
>> index 9dc3a3b88391..2b870a3f391b 100644
>> --- a/include/linux/sunrpc/svc_rdma.h
>> +++ b/include/linux/sunrpc/svc_rdma.h
>> @@ -207,8 +207,8 @@ extern void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
>> struct svc_rdma_recv_ctxt *rctxt,
>> int status);
>> extern int svc_rdma_sendto(struct svc_rqst *);
>> -extern int svc_rdma_read_payload(struct svc_rqst *rqstp, unsigned int offset,
>> - unsigned int length);
>> +extern int svc_rdma_result_payload(struct svc_rqst *rqstp, unsigned int offset,
>> + unsigned int length);
>>
>> /* svc_rdma_transport.c */
>> extern struct svc_xprt_class svc_rdma_class;
>> diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
>> index aca35ab5cff2..92455e0d5244 100644
>> --- a/include/linux/sunrpc/svc_xprt.h
>> +++ b/include/linux/sunrpc/svc_xprt.h
>> @@ -21,8 +21,8 @@ struct svc_xprt_ops {
>> int (*xpo_has_wspace)(struct svc_xprt *);
>> int (*xpo_recvfrom)(struct svc_rqst *);
>> int (*xpo_sendto)(struct svc_rqst *);
>> - int (*xpo_read_payload)(struct svc_rqst *, unsigned int,
>> - unsigned int);
>> + int (*xpo_result_payload)(struct svc_rqst *, unsigned int,
>> + unsigned int);
>> void (*xpo_release_rqst)(struct svc_rqst *);
>> void (*xpo_detach)(struct svc_xprt *);
>> void (*xpo_free)(struct svc_xprt *);
>> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
>> index c211b607239e..b41500645c3f 100644
>> --- a/net/sunrpc/svc.c
>> +++ b/net/sunrpc/svc.c
>> @@ -1622,7 +1622,7 @@ u32 svc_max_payload(const struct svc_rqst *rqstp)
>> EXPORT_SYMBOL_GPL(svc_max_payload);
>>
>> /**
>> - * svc_encode_read_payload - mark a range of bytes as a READ payload
>> + * svc_encode_result_payload - mark a range of bytes as a result payload
>> * @rqstp: svc_rqst to operate on
>> * @offset: payload's byte offset in rqstp->rq_res
>> * @length: size of payload, in bytes
>> @@ -1630,12 +1630,13 @@ EXPORT_SYMBOL_GPL(svc_max_payload);
>> * Returns zero on success, or a negative errno if a permanent
>> * error occurred.
>> */
>> -int svc_encode_read_payload(struct svc_rqst *rqstp, unsigned int offset,
>> - unsigned int length)
>> +int svc_encode_result_payload(struct svc_rqst *rqstp, unsigned int offset,
>> + unsigned int length)
>> {
>> - return rqstp->rq_xprt->xpt_ops->xpo_read_payload(rqstp, offset, length);
>> + return rqstp->rq_xprt->xpt_ops->xpo_result_payload(rqstp, offset,
>> + length);
>> }
>> -EXPORT_SYMBOL_GPL(svc_encode_read_payload);
>> +EXPORT_SYMBOL_GPL(svc_encode_result_payload);
>>
>> /**
>> * svc_fill_write_vector - Construct data argument for VFS write call
>> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
>> index c2752e2b9ce3..b248f2349437 100644
>> --- a/net/sunrpc/svcsock.c
>> +++ b/net/sunrpc/svcsock.c
>> @@ -181,8 +181,8 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
>> }
>> }
>>
>> -static int svc_sock_read_payload(struct svc_rqst *rqstp, unsigned int offset,
>> - unsigned int length)
>> +static int svc_sock_result_payload(struct svc_rqst *rqstp, unsigned int offset,
>> + unsigned int length)
>> {
>> return 0;
>> }
>> @@ -635,7 +635,7 @@ static const struct svc_xprt_ops svc_udp_ops = {
>> .xpo_create = svc_udp_create,
>> .xpo_recvfrom = svc_udp_recvfrom,
>> .xpo_sendto = svc_udp_sendto,
>> - .xpo_read_payload = svc_sock_read_payload,
>> + .xpo_result_payload = svc_sock_result_payload,
>> .xpo_release_rqst = svc_udp_release_rqst,
>> .xpo_detach = svc_sock_detach,
>> .xpo_free = svc_sock_free,
>> @@ -1123,7 +1123,7 @@ static const struct svc_xprt_ops svc_tcp_ops = {
>> .xpo_create = svc_tcp_create,
>> .xpo_recvfrom = svc_tcp_recvfrom,
>> .xpo_sendto = svc_tcp_sendto,
>> - .xpo_read_payload = svc_sock_read_payload,
>> + .xpo_result_payload = svc_sock_result_payload,
>> .xpo_release_rqst = svc_tcp_release_rqst,
>> .xpo_detach = svc_tcp_sock_detach,
>> .xpo_free = svc_sock_free,
>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
>> index c3d588b149aa..c8411b4f3492 100644
>> --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
>> +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
>> @@ -979,19 +979,19 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
>> }
>>
>> /**
>> - * svc_rdma_read_payload - special processing for a READ payload
>> + * svc_rdma_result_payload - special processing for a result payload
>> * @rqstp: svc_rqst to operate on
>> * @offset: payload's byte offset in @xdr
>> * @length: size of payload, in bytes
>> *
>> * Returns zero on success.
>> *
>> - * For the moment, just record the xdr_buf location of the READ
>> + * For the moment, just record the xdr_buf location of the result
>> * payload. svc_rdma_sendto will use that location later when
>> * we actually send the payload.
>> */
>> -int svc_rdma_read_payload(struct svc_rqst *rqstp, unsigned int offset,
>> - unsigned int length)
>> +int svc_rdma_result_payload(struct svc_rqst *rqstp, unsigned int offset,
>> + unsigned int length)
>> {
>> struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt;
>>
>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> index fb044792b571..afba4e9d5425 100644
>> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> @@ -80,7 +80,7 @@ static const struct svc_xprt_ops svc_rdma_ops = {
>> .xpo_create = svc_rdma_create,
>> .xpo_recvfrom = svc_rdma_recvfrom,
>> .xpo_sendto = svc_rdma_sendto,
>> - .xpo_read_payload = svc_rdma_read_payload,
>> + .xpo_result_payload = svc_rdma_result_payload,
>> .xpo_release_rqst = svc_rdma_release_rqst,
>> .xpo_detach = svc_rdma_detach,
>> .xpo_free = svc_rdma_free,
>>
--
Chuck Lever
next prev parent reply other threads:[~2020-10-29 0:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 18:53 [PATCH 00/20] NFSD support for multiple RPC/RDMA chunks Chuck Lever
2020-10-26 18:53 ` [PATCH 01/20] SUNRPC: Adjust synopsis of xdr_buf_subsegment() Chuck Lever
2020-10-26 18:54 ` [PATCH 02/20] svcrdma: Const-ify the xdr_buf arguments Chuck Lever
2020-10-26 18:54 ` [PATCH 03/20] svcrdma: Refactor the RDMA Write path Chuck Lever
2020-10-26 18:54 ` [PATCH 04/20] SUNRPC: Rename svc_encode_read_payload() Chuck Lever
2020-10-27 20:53 ` J. Bruce Fields
2020-10-28 13:16 ` Chuck Lever [this message]
2020-10-26 18:54 ` [PATCH 05/20] NFSD: Invoke svc_encode_result_payload() in "read" NFSD encoders Chuck Lever
2020-10-26 18:54 ` [PATCH 06/20] svcrdma: Post RDMA Writes while XDR encoding replies Chuck Lever
2020-10-26 18:54 ` [PATCH 07/20] svcrdma: Clean up svc_rdma_encode_reply_chunk() Chuck Lever
2020-10-26 18:54 ` [PATCH 08/20] svcrdma: Add a "parsed chunk list" data structure Chuck Lever
2020-10-26 18:54 ` [PATCH 09/20] svcrdma: Use parsed chunk lists to derive the inv_rkey Chuck Lever
2020-10-26 18:54 ` [PATCH 10/20] svcrdma: Use parsed chunk lists to detect reverse direction replies Chuck Lever
2020-10-26 18:54 ` [PATCH 11/20] svcrdma: Use parsed chunk lists to construct RDMA Writes Chuck Lever
2020-10-26 18:54 ` [PATCH 12/20] svcrdma: Use parsed chunk lists to encode Reply transport headers Chuck Lever
2020-10-26 18:55 ` [PATCH 13/20] svcrdma: Support multiple write chunks when pulling up Chuck Lever
2020-10-26 18:55 ` [PATCH 14/20] svcrdma: Support multiple Write chunks in svc_rdma_map_reply_msg() Chuck Lever
2020-10-26 18:55 ` [PATCH 15/20] svcrdma: Support multiple Write chunks in svc_rdma_send_reply_chunk Chuck Lever
2020-10-26 18:55 ` [PATCH 16/20] svcrdma: Remove chunk list pointers Chuck Lever
2020-10-26 18:55 ` [PATCH 17/20] svcrdma: Clean up chunk tracepoints Chuck Lever
2020-10-26 18:55 ` [PATCH 18/20] svcrdma: Rename info::ri_chunklen Chuck Lever
2020-10-26 18:55 ` [PATCH 19/20] svcrdma: Use the new parsed chunk list when pulling Read chunks Chuck Lever
2020-10-26 18:55 ` [PATCH 20/20] svcrdma: support multiple Read chunks per RPC Chuck Lever
2020-10-27 6:08 ` [PATCH 00/20] NFSD support for multiple RPC/RDMA chunks Leon Romanovsky
2020-10-27 13:24 ` Chuck Lever
2020-10-27 17:25 ` J. Bruce Fields
2020-10-27 17:29 ` Chuck Lever
2020-10-28 7:16 ` Leon Romanovsky
2020-10-28 13:10 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D74674A4-7296-4DB6-B66B-119150D1FC71@oracle.com \
--to=chuck.lever@oracle.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox