diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-02-25 17:44:21 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-05-30 17:31:47 -0400 |
commit | 3e19ce762b537dd9aeefdd0849ba5f2f01ff83cf (patch) | |
tree | 3b261560ccf50dd7efadc2f61a6762566cfdbf45 /include | |
parent | 6ac90391c6e36c536cfcedbe4801a77e304205b1 (diff) | |
download | linux-3e19ce762b537dd9aeefdd0849ba5f2f01ff83cf.tar.gz linux-3e19ce762b537dd9aeefdd0849ba5f2f01ff83cf.tar.bz2 linux-3e19ce762b537dd9aeefdd0849ba5f2f01ff83cf.zip |
rpc: xdr_truncate_encode
This will be used in the server side in a few cases:
- when certain operations (read, readdir, readlink) fail after
encoding a partial response.
- when we run out of space after encoding a partial response.
- in readlink, where we initially reserve PAGE_SIZE bytes for
data, then truncate to the actual size.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/xdr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 15f9204ee70b..e7bb2e3bd0fb 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -215,6 +215,7 @@ typedef int (*kxdrdproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj); extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); +extern void xdr_truncate_encode(struct xdr_stream *xdr, size_t len); extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, unsigned int base, unsigned int len); extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr); |