Commit 03493bca authored by Chuck Lever's avatar Chuck Lever

SUNRPC: Rename svc_encode_read_payload()

Clean up: "result payload" is a less confusing name for these
payloads. "READ payload" reflects only the NFS usage.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ab1394ee
...@@ -3829,7 +3829,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, ...@@ -3829,7 +3829,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
read->rd_length = maxcount; read->rd_length = maxcount;
if (nfserr) if (nfserr)
return 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; return nfserr_io;
xdr_truncate_encode(xdr, starting_len + 8 + xdr_align_size(maxcount)); xdr_truncate_encode(xdr, starting_len + 8 + xdr_align_size(maxcount));
......
...@@ -519,9 +519,9 @@ void svc_wake_up(struct svc_serv *); ...@@ -519,9 +519,9 @@ void svc_wake_up(struct svc_serv *);
void svc_reserve(struct svc_rqst *rqstp, int space); void svc_reserve(struct svc_rqst *rqstp, int space);
struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
char * svc_print_addr(struct svc_rqst *, char *, size_t); char * svc_print_addr(struct svc_rqst *, char *, size_t);
int svc_encode_read_payload(struct svc_rqst *rqstp, int svc_encode_result_payload(struct svc_rqst *rqstp,
unsigned int offset, unsigned int offset,
unsigned int length); unsigned int length);
unsigned int svc_fill_write_vector(struct svc_rqst *rqstp, unsigned int svc_fill_write_vector(struct svc_rqst *rqstp,
struct page **pages, struct page **pages,
struct kvec *first, size_t total); struct kvec *first, size_t total);
......
...@@ -207,8 +207,8 @@ extern void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, ...@@ -207,8 +207,8 @@ extern void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
struct svc_rdma_recv_ctxt *rctxt, struct svc_rdma_recv_ctxt *rctxt,
int status); int status);
extern int svc_rdma_sendto(struct svc_rqst *); extern int svc_rdma_sendto(struct svc_rqst *);
extern int svc_rdma_read_payload(struct svc_rqst *rqstp, unsigned int offset, extern int svc_rdma_result_payload(struct svc_rqst *rqstp, unsigned int offset,
unsigned int length); unsigned int length);
/* svc_rdma_transport.c */ /* svc_rdma_transport.c */
extern struct svc_xprt_class svc_rdma_class; extern struct svc_xprt_class svc_rdma_class;
......
...@@ -21,8 +21,8 @@ struct svc_xprt_ops { ...@@ -21,8 +21,8 @@ struct svc_xprt_ops {
int (*xpo_has_wspace)(struct svc_xprt *); int (*xpo_has_wspace)(struct svc_xprt *);
int (*xpo_recvfrom)(struct svc_rqst *); int (*xpo_recvfrom)(struct svc_rqst *);
int (*xpo_sendto)(struct svc_rqst *); int (*xpo_sendto)(struct svc_rqst *);
int (*xpo_read_payload)(struct svc_rqst *, unsigned int, int (*xpo_result_payload)(struct svc_rqst *, unsigned int,
unsigned int); unsigned int);
void (*xpo_release_rqst)(struct svc_rqst *); void (*xpo_release_rqst)(struct svc_rqst *);
void (*xpo_detach)(struct svc_xprt *); void (*xpo_detach)(struct svc_xprt *);
void (*xpo_free)(struct svc_xprt *); void (*xpo_free)(struct svc_xprt *);
......
...@@ -1622,7 +1622,7 @@ u32 svc_max_payload(const struct svc_rqst *rqstp) ...@@ -1622,7 +1622,7 @@ u32 svc_max_payload(const struct svc_rqst *rqstp)
EXPORT_SYMBOL_GPL(svc_max_payload); 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 * @rqstp: svc_rqst to operate on
* @offset: payload's byte offset in rqstp->rq_res * @offset: payload's byte offset in rqstp->rq_res
* @length: size of payload, in bytes * @length: size of payload, in bytes
...@@ -1630,12 +1630,13 @@ EXPORT_SYMBOL_GPL(svc_max_payload); ...@@ -1630,12 +1630,13 @@ EXPORT_SYMBOL_GPL(svc_max_payload);
* Returns zero on success, or a negative errno if a permanent * Returns zero on success, or a negative errno if a permanent
* error occurred. * error occurred.
*/ */
int svc_encode_read_payload(struct svc_rqst *rqstp, unsigned int offset, int svc_encode_result_payload(struct svc_rqst *rqstp, unsigned int offset,
unsigned int length) 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 * svc_fill_write_vector - Construct data argument for VFS write call
......
...@@ -181,8 +181,8 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) ...@@ -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, static int svc_sock_result_payload(struct svc_rqst *rqstp, unsigned int offset,
unsigned int length) unsigned int length)
{ {
return 0; return 0;
} }
...@@ -635,7 +635,7 @@ static const struct svc_xprt_ops svc_udp_ops = { ...@@ -635,7 +635,7 @@ static const struct svc_xprt_ops svc_udp_ops = {
.xpo_create = svc_udp_create, .xpo_create = svc_udp_create,
.xpo_recvfrom = svc_udp_recvfrom, .xpo_recvfrom = svc_udp_recvfrom,
.xpo_sendto = svc_udp_sendto, .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_release_rqst = svc_udp_release_rqst,
.xpo_detach = svc_sock_detach, .xpo_detach = svc_sock_detach,
.xpo_free = svc_sock_free, .xpo_free = svc_sock_free,
...@@ -1123,7 +1123,7 @@ static const struct svc_xprt_ops svc_tcp_ops = { ...@@ -1123,7 +1123,7 @@ static const struct svc_xprt_ops svc_tcp_ops = {
.xpo_create = svc_tcp_create, .xpo_create = svc_tcp_create,
.xpo_recvfrom = svc_tcp_recvfrom, .xpo_recvfrom = svc_tcp_recvfrom,
.xpo_sendto = svc_tcp_sendto, .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_release_rqst = svc_tcp_release_rqst,
.xpo_detach = svc_tcp_sock_detach, .xpo_detach = svc_tcp_sock_detach,
.xpo_free = svc_sock_free, .xpo_free = svc_sock_free,
......
...@@ -979,19 +979,19 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) ...@@ -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 * @rqstp: svc_rqst to operate on
* @offset: payload's byte offset in @xdr * @offset: payload's byte offset in @xdr
* @length: size of payload, in bytes * @length: size of payload, in bytes
* *
* Returns zero on success. * 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 * payload. svc_rdma_sendto will use that location later when
* we actually send the payload. * we actually send the payload.
*/ */
int svc_rdma_read_payload(struct svc_rqst *rqstp, unsigned int offset, int svc_rdma_result_payload(struct svc_rqst *rqstp, unsigned int offset,
unsigned int length) unsigned int length)
{ {
struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt; struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt;
......
...@@ -80,7 +80,7 @@ static const struct svc_xprt_ops svc_rdma_ops = { ...@@ -80,7 +80,7 @@ static const struct svc_xprt_ops svc_rdma_ops = {
.xpo_create = svc_rdma_create, .xpo_create = svc_rdma_create,
.xpo_recvfrom = svc_rdma_recvfrom, .xpo_recvfrom = svc_rdma_recvfrom,
.xpo_sendto = svc_rdma_sendto, .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_release_rqst = svc_rdma_release_rqst,
.xpo_detach = svc_rdma_detach, .xpo_detach = svc_rdma_detach,
.xpo_free = svc_rdma_free, .xpo_free = svc_rdma_free,
......
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