summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2022-06-07 16:48:11 -0400
committerChuck Lever <chuck.lever@oracle.com>2022-06-08 12:39:37 -0400
commitbd07a64176a2be03f5195c64943063fd119f9f21 (patch)
tree977e60059406a8857e9553557b78277534eceff7 /net
parent90d871b3b9bb7ef8f835d6b53095f01b9c74b7b3 (diff)
downloadlinux-stable-bd07a64176a2be03f5195c64943063fd119f9f21.tar.gz
linux-stable-bd07a64176a2be03f5195c64943063fd119f9f21.tar.bz2
linux-stable-bd07a64176a2be03f5195c64943063fd119f9f21.zip
SUNRPC: Clean up xdr_get_next_encode_buffer()
The value of @p is not used until the "location of the next item" is computed. Help human readers by moving its initial assignment to the paragraph where that value is used and by clarifying the antecedents in the documenting comment. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: NeilBrown <neilb@suse.com> Reviewed-by: J. Bruce Fields <bfields@fieldses.org>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xdr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 3c182041e790..eca02d122476 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -967,6 +967,7 @@ static noinline __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
xdr->buf->page_len += frag1bytes;
xdr->page_ptr++;
xdr->iov = NULL;
+
/*
* If the last encode didn't end exactly on a page boundary, the
* next one will straddle boundaries. Encode into the next
@@ -975,11 +976,12 @@ static noinline __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
* space at the end of the previous buffer:
*/
xdr_set_scratch_buffer(xdr, xdr->p, frag1bytes);
- p = page_address(*xdr->page_ptr);
+
/*
- * Note this is where the next encode will start after we've
- * shifted this one back:
+ * xdr->p is where the next encode will start after
+ * xdr_commit_encode() has shifted this one back:
*/
+ p = page_address(*xdr->page_ptr);
xdr->p = (void *)p + frag2bytes;
space_left = xdr->buf->buflen - xdr->buf->len;
if (space_left - nbytes >= PAGE_SIZE)