NFSD: Add nfsd4_encode_lock_owner4()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 29 Sep 2023 13:58:53 +0000 (09:58 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:30 +0000 (12:44 -0400)
commitc4a29c52506519eeb447800d88a22a6f7bce976c
tree0f125a301365c402bae027080f53687cda6e559a
parent92d82e995ee221578a729998d11d0fa7fbb3e41c
NFSD: Add nfsd4_encode_lock_owner4()

To improve readability and better align the LOCK encoders with the
XDR specification, add an explicit encoder named for the lock_owner4
type.

In particular, to avoid code duplication, use
nfsd4_encode_clientid4() to encode the clientid in the lock owner
rather than open-coding it.

It looks to me like nfs4_set_lock_denied() already clears the
clientid if it won't return an owner (cf: the nevermind: label). The
code in the XDR encoder appears to be redundant and can safely be
removed.

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