]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lockd: Refactor nlm4svc_callback()
authorChuck Lever <chuck.lever@oracle.com>
Tue, 17 Feb 2026 22:07:00 +0000 (17:07 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
commit3086ad11ab6ca4a95d7d65b87c40b8cbb60921a0
treec4b3e893253c4f2db5afb49a192338c011a917b1
parent8de56f61e2d2f2534620e2f8ffc32243c13e139e
lockd: Refactor nlm4svc_callback()

The xdrgen-based XDR conversion requires each RPC procedure
to handle its own argument extraction, since xdrgen generates
distinct argument structures for each procedure rather than
using a single shared type.

This patch moves the host lookup logic from nlm4svc_callback()
into each of the five MSG procedure handlers (TEST_MSG,
LOCK_MSG, CANCEL_MSG, UNLOCK_MSG, and GRANTED_MSG). Each
handler now performs its own host lookup from rqstp->rq_argp
and passes the resulting host pointer to nlm4svc_callback(),
which is reduced to a simpler helper that only dispatches
the callback.

This refactoring enables the subsequent xdrgen conversion
patches by establishing the pattern where each procedure
handles its own argument extraction, while preserving
existing callback behavior unchanged.

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