From: Chuck Lever Date: Wed, 28 Jan 2026 15:19:28 +0000 (-0500) Subject: lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/ X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4d5f8caadd858f11b21e8a9e5c85290fc21a568;p=thirdparty%2Fkernel%2Fstable.git lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/ The xdr4.h header declares NLMv4-specific XDR encoder/decoder functions and error codes that are used exclusively within the lockd subsystem. Moving it from include/linux/lockd/ to fs/lockd/ clarifies the intended scope of these declarations and prevents external code from depending on lockd-internal interfaces. This change reduces the public API surface of the lockd module and makes it easier to refactor NLMv4 internals without risk of breaking out-of-tree consumers. The header's contents are implementation details of the NLMv4 wire protocol handling, not a contract with other kernel subsystems. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c index 527458db4525a..23896073c7e5b 100644 --- a/fs/lockd/clnt4xdr.c +++ b/fs/lockd/clnt4xdr.c @@ -17,6 +17,8 @@ #include +#include "xdr4.h" + #define NLMDBG_FACILITY NLMDBG_XDR #if (NLMCLNT_OHSIZE > XDR_MAX_NETOBJ) diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c index 4ceb27cc72e4d..51d072a83a49f 100644 --- a/fs/lockd/svc4proc.c +++ b/fs/lockd/svc4proc.c @@ -14,6 +14,8 @@ #include #include +#include "xdr4.h" + #define NLMDBG_FACILITY NLMDBG_CLIENT /* diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c index e343c820301fd..5b1e15977697c 100644 --- a/fs/lockd/xdr4.c +++ b/fs/lockd/xdr4.c @@ -19,6 +19,7 @@ #include #include "svcxdr.h" +#include "xdr4.h" static inline s64 loff_t_to_s64(loff_t offset) diff --git a/include/linux/lockd/xdr4.h b/fs/lockd/xdr4.h similarity index 84% rename from include/linux/lockd/xdr4.h rename to fs/lockd/xdr4.h index 72831e35dca32..7be318c0512bd 100644 --- a/include/linux/lockd/xdr4.h +++ b/fs/lockd/xdr4.h @@ -1,19 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * linux/include/linux/lockd/xdr4.h - * * XDR types for the NLM protocol * * Copyright (C) 1996 Olaf Kirch */ -#ifndef LOCKD_XDR4_H -#define LOCKD_XDR4_H - -#include -#include -#include -#include +#ifndef _LOCKD_XDR4_H +#define _LOCKD_XDR4_H /* error codes new to NLMv4 */ #define nlm4_deadlock cpu_to_be32(NLM_DEADLCK) @@ -38,6 +31,4 @@ bool nlm4svc_encode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); bool nlm4svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); bool nlm4svc_encode_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr); -extern const struct rpc_version nlm_version4; - -#endif /* LOCKD_XDR4_H */ +#endif /* _LOCKD_XDR4_H */ diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 39c124dcb19c8..077da0696f12a 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h @@ -13,9 +13,6 @@ #include /* need xdr-encoded error codes too, so... */ #include -#ifdef CONFIG_LOCKD_V4 -#include -#endif /* Dummy declarations */ struct svc_rqst; diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0d883f48ec211..46f2441416451 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -22,9 +22,6 @@ #include #include #include -#ifdef CONFIG_LOCKD_V4 -#include -#endif #include #include @@ -235,6 +232,10 @@ int nlmclnt_reclaim(struct nlm_host *, struct file_lock *, struct nlm_rqst *); void nlmclnt_next_cookie(struct nlm_cookie *); +#ifdef CONFIG_LOCKD_V4 +extern const struct rpc_version nlm_version4; +#endif + /* * Host cache */