]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lockd: Use xdrgen XDR functions for the NLMv4 LOCK procedure
authorChuck Lever <chuck.lever@oracle.com>
Tue, 17 Feb 2026 22:06:56 +0000 (17:06 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
commit6cb785ab81bcb76c6ac985f9684c1d9118154427
tree379ebb0f4f5298ae53191fe0998b9d9b248698e4
parent3de744ee4e4557da0d63be8a97ad44b4dad58912
lockd: Use xdrgen XDR functions for the NLMv4 LOCK procedure

Replace legacy XDR handling in the LOCK procedure with xdrgen-
generated functions nlm4_svc_decode_lockargs and
nlm4_svc_encode_res.

The new nlm4svc_do_lock() handler replaces __nlm4svc_proc_lock()
at the NLMPROC4_LOCK entry point. Wrapper structures bridge
xdrgen types to the legacy nlm_lock representation used by core
lockd. The nlm4svc_lookup_host() and nlm4svc_lookup_file()
helpers from the TEST conversion handle host and file lookup.

The pc_argzero field is set to zero: xdrgen-generated decoders
initialize all fields in argp->xdrgen, so a defensive memset is
unnecessary. The wrapper's cookie and lock fields are cleared
by nlm4svc_do_lock() before use.

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