mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
SUNRPC: Add the helper xdr_stream_pos
Add a helper to report the current offset from the start of the xdr_stream. Signed-off-by: Trond Myklebust <[email protected]>
This commit is contained in:
parent
64bd577ea0
commit
4517d526c8
2 changed files with 11 additions and 0 deletions
|
|
@ -454,6 +454,16 @@ xdr_shift_buf(struct xdr_buf *buf, size_t len)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(xdr_shift_buf);
|
||||
|
||||
/**
|
||||
* xdr_stream_pos - Return the current offset from the start of the xdr_stream
|
||||
* @xdr: pointer to struct xdr_stream
|
||||
*/
|
||||
unsigned int xdr_stream_pos(const struct xdr_stream *xdr)
|
||||
{
|
||||
return (unsigned int)(XDR_QUADLEN(xdr->buf->len) - xdr->nwords) << 2;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xdr_stream_pos);
|
||||
|
||||
/**
|
||||
* xdr_init_encode - Initialize a struct xdr_stream for sending data.
|
||||
* @xdr: pointer to xdr_stream struct
|
||||
|
|
|
|||
Loading…
Reference in a new issue