summaryrefslogtreecommitdiff
path: root/fs/lockd/trace.h
AgeCommit message (Collapse)Author
2026-06-09lockd: Use xdrgen XDR functions for the NLMv3 GRANTED procedureChuck Lever
The NLM GRANTED procedure allows servers to notify clients when a previously blocked lock request has been granted, completing the asynchronous lock request flow. This patch converts the NLMv3 GRANTED procedure to use xdrgen-generated XDR functions. The conversion replaces the legacy decoder with the xdrgen functions nlm_svc_decode_nlm_testargs and nlm_svc_encode_nlm_res generated from the NLM version 3 protocol specification. The procedure handler accesses xdrgen types through a wrapper structure that bridges between generated code and the legacy lockd_lock representation still used by the core lockd logic. A new helper function nlm_lock_to_lockd_lock() converts an xdrgen nlm_lock into the legacy lockd_lock format. The helper complements the existing nlm3svc_lookup_host() and nlm3svc_lookup_file() functions used throughout this series. Setting pc_argzero to zero is safe because the generated decoder fills the argp->xdrgen subfields before the procedure runs, so the zeroing memset performed by the dispatch layer is not needed. The helper populates each field of the wrapper's lock member that any downstream consumer reads: fh, oh, svid, and the file_lock byte range. Because pc_argzero no longer scrubs the rq_argp slot, the shared nlmclnt_lock_event tracepoint class is updated to source its byte-range fields from lock->fl.fl_start and lock->fl.fl_end, which both the client and server populate unconditionally; the old lock_start and lock_len fields are no longer required by the trace. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2026-06-09lockd: Rename struct nlm_lock to lockd_lockChuck Lever
A subsequent patch will convert fs/lockd/svcproc.c to use machine-generated XDR encoding and decoding functions in a manner similar to fs/lockd/svc4proc.c. Machine-generated types derived from the NLM specification will conflict with the internal types of the same name. Rename the internal struct nlm_lock type to lockd_lock to avoid such naming conflicts. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2026-03-29lockd: Relocate include/linux/lockd/lockd.hChuck Lever
Headers placed in include/linux/ form part of the kernel's internal API and signal to subsystem maintainers that other parts of the kernel may depend on them. By moving lockd.h into fs/lockd/, lockd becomes a more self-contained module whose internal interfaces are clearly distinguished from its public contract with the rest of the kernel. This relocation addresses a long-standing XXX comment in the header itself that acknowledged the file's misplacement. Future changes to lockd internals can now proceed with confidence that external consumers are not inadvertently coupled to implementation details. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2023-04-26lockd: add some client-side tracepointsJeff Layton
Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>