NFSD: Extract the svcxdr_init_encode() helper
authorChuck Lever <chuck.lever@oracle.com>
Tue, 27 Oct 2020 19:53:42 +0000 (15:53 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 22 Mar 2021 14:18:51 +0000 (10:18 -0400)
commitbddfdbcddbe267519cd36aeb115fdf8620980111
tree1ca622b4eabf7a11da5b50115bff0d4f670d5d9b
parent0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b
NFSD: Extract the svcxdr_init_encode() helper

NFSD initializes an encode xdr_stream only after the RPC layer has
already inserted the RPC Reply header. Thus it behaves differently
than xdr_init_encode does, which assumes the passed-in xdr_buf is
entirely devoid of content.

nfs4proc.c has this server-side stream initialization helper, but
it is visible only to the NFSv4 code. Move this helper to a place
that can be accessed by NFSv2 and NFSv3 server XDR functions.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/nfssvc.c
fs/nfsd/xdr4.h
include/linux/sunrpc/svc.h