]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 Jan 2026 15:19:28 +0000 (10:19 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
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 <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/clnt4xdr.c
fs/lockd/svc4proc.c
fs/lockd/xdr4.c
fs/lockd/xdr4.h [moved from include/linux/lockd/xdr4.h with 84% similarity]
include/linux/lockd/bind.h
include/linux/lockd/lockd.h

index 527458db4525af3e76d9119feb6e5e5b62890741..23896073c7e5bf98faee80a5f7f283e0cb6eef78 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <uapi/linux/nfs3.h>
 
+#include "xdr4.h"
+
 #define NLMDBG_FACILITY                NLMDBG_XDR
 
 #if (NLMCLNT_OHSIZE > XDR_MAX_NETOBJ)
index 4ceb27cc72e4d9202ba9a54f0f3570fc3cc50b2f..51d072a83a49fdeb25d356efe418ea6f538e0944 100644 (file)
@@ -14,6 +14,8 @@
 #include <linux/lockd/share.h>
 #include <linux/sunrpc/svc_xprt.h>
 
+#include "xdr4.h"
+
 #define NLMDBG_FACILITY                NLMDBG_CLIENT
 
 /*
index e343c820301fd1dca59293dabc0ffd38949b3ac4..5b1e15977697c05fec9fd96fa72c9c4dabaddf14 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/lockd/lockd.h>
 
 #include "svcxdr.h"
+#include "xdr4.h"
 
 static inline s64
 loff_t_to_s64(loff_t offset)
similarity index 84%
rename from include/linux/lockd/xdr4.h
rename to fs/lockd/xdr4.h
index 72831e35dca32d7412d2705fd38b00ac029d5927..7be318c0512bda2d6ee1fb737546fdc5601ef5fc 100644 (file)
@@ -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 <okir@monad.swb.de>
  */
 
-#ifndef LOCKD_XDR4_H
-#define LOCKD_XDR4_H
-
-#include <linux/fs.h>
-#include <linux/nfs.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/lockd/xdr.h>
+#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 */
index 39c124dcb19c8f882859184da2cd1aa1b65f37d1..077da0696f12a737e83de6fec08d947f82a6d376 100644 (file)
@@ -13,9 +13,6 @@
 #include <linux/lockd/nlm.h>
 /* need xdr-encoded error codes too, so... */
 #include <linux/lockd/xdr.h>
-#ifdef CONFIG_LOCKD_V4
-#include <linux/lockd/xdr4.h>
-#endif
 
 /* Dummy declarations */
 struct svc_rqst;
index 0d883f48ec211f4be533bd2cca15035dfb1464af..46f2441416451d68919044536911882811c377a2 100644 (file)
@@ -22,9 +22,6 @@
 #include <linux/utsname.h>
 #include <linux/lockd/bind.h>
 #include <linux/lockd/xdr.h>
-#ifdef CONFIG_LOCKD_V4
-#include <linux/lockd/xdr4.h>
-#endif
 #include <linux/lockd/debug.h>
 #include <linux/sunrpc/svc.h>
 
@@ -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
  */