NFSD: Clean up nfsd4_encode_copy_notify()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 9 Oct 2023 18:30:16 +0000 (14:30 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:37 +0000 (12:44 -0400)
commit21d316a767ac2ebc9de281cd2ec5f3c22827dd8e
tree5e03bded3e0e64a4e430e3ae9815ba99ed5206e1
parent02e0297f160aa1ba9835fed3c97845c9450c2dc3
NFSD: Clean up nfsd4_encode_copy_notify()

Replace open-coded encoding logic with the use of conventional XDR
utility functions.

Note that if we replace the cpn_sec and cpn_nsec fields with a
single struct timespec64 field, the encoder can use
nfsd4_encode_nfstime4(), as that is the data type specified by the
XDR spec.

NFS4ERR_INVAL seems inappropriate if the encoder doesn't support
encoding the response. Instead use NFS4ERR_SERVERFAULT, since this
condition is a software bug on the server.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4xdr.c
fs/nfsd/xdr4.h