]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Clean up helpers xdr_set_iov() and xdr_set_page_base()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 21 Nov 2020 19:50:43 +0000 (14:50 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:53 +0000 (14:05 -0500)
commitb49ca9e7162bfd662206c87bc313bbd03bdc12c8
treea73b499bafee1d7d38c88f0389e57e490b020640
parentca729d2f259107841cef5fbfe1307cb972698c9c
SUNRPC: Clean up helpers xdr_set_iov() and xdr_set_page_base()

Allow xdr_set_iov() to set a base so that we can use it to set the
cursor to a specific position in the kvec buffer.

If the new base overflows the kvec/pages buffer in either xdr_set_iov()
or xdr_set_page_base(), then truncate it so that we point to the end of
the buffer.

Finally, change both function to return the number of bytes remaining to
read in their buffers.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xdr.c