]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nfsd4: "backfill" using write_bytes_to_xdr_buf
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 29 Aug 2013 19:42:52 +0000 (15:42 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 28 May 2014 18:52:40 +0000 (14:52 -0400)
commit9662098f1cf6438aa0cfb77568df6d44c1cb0d0a
tree8c1fda0c855b96d94bcce45f527bbcd763c5324c
parent3296a16ed1f1a2a3296cf71b8a75e9c1ce592abb
nfsd4: "backfill" using write_bytes_to_xdr_buf

Normally xdr encoding proceeds in a single pass from start of a buffer
to end, but sometimes we have to write a few bytes to an earlier
position.

Use write_bytes_to_xdr_buf for these cases rather than saving a pointer
to write to.  We plan to rewrite xdr_reserve_space to handle encoding
across page boundaries using a scratch buffer, and don't want to risk
writing to a pointer that was contained in a scratch buffer.

Also it will no longer be safe to calculate lengths by subtracting two
pointers, so use xdr_buf offsets instead.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c