diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2018-03-27 17:54:07 +0300 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-04-03 22:08:16 +0300 |
commit | 8154ef2776aa512a3eaa0e7db030dc4803354d61 (patch) | |
tree | 31d1305f1037911ae53b0ce3c13b044d942ddd30 /kernel/module-internal.h | |
parent | fff4080b2f1389ecf3028d72eb70e1837df48b01 (diff) | |
download | linux-8154ef2776aa512a3eaa0e7db030dc4803354d61.tar.xz |
NFSD: Clean up legacy NFS WRITE argument XDR decoders
Move common code in NFSD's legacy NFS WRITE decoders into a helper.
The immediate benefit is reduction of code duplication and some nice
micro-optimizations (see below).
In the long term, this helper can perform a per-transport call-out
to fill the rq_vec (say, using RDMA Reads).
The legacy WRITE decoders and procs are changed to work like NFSv4,
which constructs the rq_vec just before it is about to call
vfs_writev.
Why? Calling a transport call-out from the proc instead of the XDR
decoder means that the incoming FH can be resolved to a particular
filesystem and file. This would allow pages from the backing file to
be presented to the transport to be filled, rather than presenting
anonymous pages and copying or flipping them into the file's page
cache later.
I also prefer using the pages in rq_arg.pages, instead of pulling
the data pages directly out of the rqstp::rq_pages array. This is
currently the way the NFSv3 write decoder works, but the other two
do not seem to take this approach. Fixing this removes the only
reference to rq_pages found in NFSD, eliminating an NFSD assumption
about how transports use the pages in rq_pages.
Lastly, avoid setting up the first element of rq_vec as a zero-
length buffer. This happens with an RDMA transport when a normal
Read chunk is present because the data payload is in rq_arg's
page list (none of it is in the head buffer).
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'kernel/module-internal.h')
0 files changed, 0 insertions, 0 deletions