Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320188
b: refs/heads/master
c: bd00f84
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 28, 2012
1 parent db7ca26 commit 24d39b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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: b760b3131d962dd35925fb65956afe621fa65ec4
refs/heads/master: bd00f84bc57f42df32c728e86329a5c30f221657
15 changes: 7 additions & 8 deletions trunk/net/sunrpc/xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,10 @@ unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
{
struct xdr_buf *buf = xdr->buf;
struct kvec *iov;
ssize_t shift;
unsigned int nwords = XDR_QUADLEN(len);
unsigned int cur = xdr_stream_pos(xdr);
unsigned int end;
int padding;
unsigned int padding;

if (xdr->nwords == 0)
return 0;
Expand All @@ -782,15 +781,15 @@ unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
/* Truncate page data and move it into the tail */
if (buf->page_len > len)
xdr_shrink_pagelen(buf, buf->page_len - len);
xdr->nwords = XDR_QUADLEN(buf->len - cur);

padding = (nwords << 2) - len;
xdr->iov = iov = buf->tail;
/* Compute remaining message length. */
end = iov->iov_len;
shift = buf->buflen - buf->len;
if (end > shift + padding)
end -= shift;
else
end = padding;
end = ((xdr->nwords - nwords) << 2) + padding;
if (end > iov->iov_len)
end = iov->iov_len;

/*
* Position current pointer at beginning of tail, and
* set remaining message length.
Expand Down

0 comments on commit 24d39b9

Please sign in to comment.