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

The NLM GRANTED procedure provides server-to-client notification
when a previously blocked lock request has been granted,
completing the asynchronous lock request flow. This patch
completes the xdrgen migration for basic NLMv4 procedures by
converting the GRANTED procedure, the final one in this
conversion series.

This patch converts the GRANTED procedure to use xdrgen
functions nlm4_svc_decode_nlm4_testargs and
nlm4_svc_encode_nlm4_res generated from the NLM version 4
protocol specification. The procedure handler uses xdrgen types
through a wrapper structure that bridges between generated code
and the legacy nlm_lock representation still used by the core
lockd logic.

A new helper function nlm4_lock_to_nlm_lock() is introduced to
convert xdrgen nlm4_lock structures to the legacy nlm_lock
format. This helper complements the existing
nlm4svc_lookup_host() and nlm4svc_lookup_file() functions used
throughout this series.

The pc_argzero field is set to zero because xdrgen decoders
reliably initialize all arguments in the argp->xdrgen field,
making the early defensive memset unnecessary. Remaining argp
fields are cleared as needed.

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