Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320182
b: refs/heads/master
c: c337d36
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 28, 2012
1 parent ce1bef7 commit 70a5894
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfeea1dc1c9238f9e5a17a265489ecd0d19f66bb
refs/heads/master: c337d3655ce85e12c7c476cb81406521926cacd2
2 changes: 1 addition & 1 deletion trunk/include/linux/sunrpc/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf,
struct page **pages, unsigned int len);
extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen);
extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
extern unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);

Expand Down
9 changes: 6 additions & 3 deletions trunk/net/sunrpc/xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,10 @@ EXPORT_SYMBOL_GPL(xdr_inline_decode);
* Moves data beyond the current pointer position from the XDR head[] buffer
* into the page list. Any data that lies beyond current position + "len"
* bytes is moved into the XDR tail[].
*
* Returns the number of XDR encoded bytes now contained in the pages
*/
void xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
{
struct xdr_buf *buf = xdr->buf;
struct kvec *iov;
Expand All @@ -756,7 +758,7 @@ void xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
int padding;

if (xdr->nwords == 0)
return;
return 0;
if (nwords > xdr->nwords) {
nwords = xdr->nwords;
len = nwords << 2;
Expand Down Expand Up @@ -787,6 +789,7 @@ void xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
xdr->end = (__be32 *)((char *)iov->iov_base + end);
xdr->page_ptr = NULL;
xdr->nwords = XDR_QUADLEN(end - padding);
return len;
}
EXPORT_SYMBOL_GPL(xdr_read_pages);

Expand All @@ -802,7 +805,7 @@ EXPORT_SYMBOL_GPL(xdr_read_pages);
*/
void xdr_enter_page(struct xdr_stream *xdr, unsigned int len)
{
xdr_read_pages(xdr, len);
len = xdr_read_pages(xdr, len);
/*
* Position current pointer at beginning of tail, and
* set remaining message length.
Expand Down

0 comments on commit 70a5894

Please sign in to comment.