Skip to content
Commit 7f87fc2d authored by Chuck Lever's avatar Chuck Lever
Browse files

NFSD: Update NFSv3 READDIR entry encoders to use struct xdr_stream



The benefit of the xdr_stream helpers is that they transparently
handle encoding an XDR data item that crosses page boundaries.
Most of the open-coded logic to do that here can be eliminated.

A sub-buffer and sub-stream are set up as a sink buffer for the
directory entry encoder. As an entry is encoded, it is added to
the end of the content in this buffer/stream. The total length of
the directory list is tracked in the buffer's @len field.

When it comes time to encode the Reply, the sub-buffer is merged
into rq_res's page array at the correct place using
xdr_write_pages().

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent e4ccfe30
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment