Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333117
b: refs/heads/master
c: a11a2bf
h: refs/heads/master
i:
  333115: cf2541c
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 28, 2012
1 parent 9ab44ee commit 4fc4126
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 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: 13fe4ba1b64c099843c75b4f0633ad30a4526637
refs/heads/master: a11a2bf4de5679fa0b63474c7d39bea2dac7d061
23 changes: 13 additions & 10 deletions trunk/net/sunrpc/xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,21 +730,24 @@ static unsigned int xdr_align_pages(struct xdr_stream *xdr, unsigned int len)

if (xdr->nwords == 0)
return 0;
if (nwords > xdr->nwords) {
nwords = xdr->nwords;
len = nwords << 2;
}
/* Realign pages to current pointer position */
iov = buf->head;
if (iov->iov_len > cur)
if (iov->iov_len > cur) {
xdr_shrink_bufhead(buf, iov->iov_len - cur);
xdr->nwords = XDR_QUADLEN(buf->len - cur);
}

/* Truncate page data and move it into the tail */
if (buf->page_len > len)
xdr_shrink_pagelen(buf, buf->page_len - len);
else
if (nwords > xdr->nwords) {
nwords = xdr->nwords;
len = nwords << 2;
}
if (buf->page_len <= len)
len = buf->page_len;
xdr->nwords = XDR_QUADLEN(buf->len - cur);
else if (nwords < xdr->nwords) {
/* Truncate page data and move it into the tail */
xdr_shrink_pagelen(buf, buf->page_len - len);
xdr->nwords = XDR_QUADLEN(buf->len - cur);
}
return len;
}

Expand Down

0 comments on commit 4fc4126

Please sign in to comment.