Skip to content

Commit bd07a64

Browse files
committed
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 <[email protected]> Reviewed-by: NeilBrown <[email protected]> Reviewed-by: J. Bruce Fields <[email protected]>
1 parent 90d871b commit bd07a64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/sunrpc/xdr.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ static noinline __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
967967
xdr->buf->page_len += frag1bytes;
968968
xdr->page_ptr++;
969969
xdr->iov = NULL;
970+
970971
/*
971972
* If the last encode didn't end exactly on a page boundary, the
972973
* 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,
975976
* space at the end of the previous buffer:
976977
*/
977978
xdr_set_scratch_buffer(xdr, xdr->p, frag1bytes);
978-
p = page_address(*xdr->page_ptr);
979+
979980
/*
980-
* Note this is where the next encode will start after we've
981-
* shifted this one back:
981+
* xdr->p is where the next encode will start after
982+
* xdr_commit_encode() has shifted this one back:
982983
*/
984+
p = page_address(*xdr->page_ptr);
983985
xdr->p = (void *)p + frag2bytes;
984986
space_left = xdr->buf->buflen - xdr->buf->len;
985987
if (space_left - nbytes >= PAGE_SIZE)

0 commit comments

Comments
 (0)