From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neil@brown.name>, Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v1 06/36] lockd: Relocate include/linux/lockd/lockd.h
Date: Thu, 18 Dec 2025 15:13:16 -0500 [thread overview]
Message-ID: <20251218201346.1190928-7-cel@kernel.org> (raw)
In-Reply-To: <20251218201346.1190928-1-cel@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
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.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/lockd/clnt4xdr.c | 3 ++-
fs/lockd/clntlock.c | 2 +-
fs/lockd/clntproc.c | 2 +-
fs/lockd/clntxdr.c | 3 ++-
fs/lockd/host.c | 2 +-
{include/linux => fs}/lockd/lockd.h | 12 +++---------
fs/lockd/mon.c | 2 +-
fs/lockd/svc.c | 2 +-
fs/lockd/svc4proc.c | 2 +-
fs/lockd/svclock.c | 3 ++-
fs/lockd/svcproc.c | 2 +-
fs/lockd/svcshare.c | 2 +-
fs/lockd/svcsubs.c | 2 +-
fs/lockd/trace.h | 3 ++-
fs/lockd/xdr.c | 3 +--
fs/lockd/xdr4.c | 2 +-
16 files changed, 22 insertions(+), 25 deletions(-)
rename {include/linux => fs}/lockd/lockd.h (98%)
diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c
index 23896073c7e5..61ee5fa6dfa4 100644
--- a/fs/lockd/clnt4xdr.c
+++ b/fs/lockd/clnt4xdr.c
@@ -13,7 +13,8 @@
#include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/stats.h>
-#include <linux/lockd/lockd.h>
+
+#include "lockd.h"
#include <uapi/linux/nfs3.h>
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index a7e0519ec024..8a38d1b193fc 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -15,9 +15,9 @@
#include <linux/sunrpc/addr.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svc_xprt.h>
-#include <linux/lockd/lockd.h>
#include <linux/kthread.h>
+#include "lockd.h"
#include "trace.h"
#define NLMDBG_FACILITY NLMDBG_CLIENT
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index cebcc283b7ce..9be003bbf5ad 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -18,8 +18,8 @@
#include <linux/freezer.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
-#include <linux/lockd/lockd.h>
+#include "lockd.h"
#include "trace.h"
#define NLMDBG_FACILITY NLMDBG_CLIENT
diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c
index 30aa5af219d4..56a2adf4f717 100644
--- a/fs/lockd/clntxdr.c
+++ b/fs/lockd/clntxdr.c
@@ -15,7 +15,8 @@
#include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/stats.h>
-#include <linux/lockd/lockd.h>
+
+#include "lockd.h"
#include <uapi/linux/nfs2.h>
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 5e6877c37f73..4a6f596f7c73 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -16,13 +16,13 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/addr.h>
#include <linux/sunrpc/svc.h>
-#include <linux/lockd/lockd.h>
#include <linux/mutex.h>
#include <linux/sunrpc/svc_xprt.h>
#include <net/ipv6.h>
+#include "lockd.h"
#include "netns.h"
#define NLMDBG_FACILITY NLMDBG_HOSTCACHE
diff --git a/include/linux/lockd/lockd.h b/fs/lockd/lockd.h
similarity index 98%
rename from include/linux/lockd/lockd.h
rename to fs/lockd/lockd.h
index 0ad66072d2a3..0b427a725c23 100644
--- a/include/linux/lockd/lockd.h
+++ b/fs/lockd/lockd.h
@@ -1,16 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
- * linux/include/linux/lockd/lockd.h
- *
- * General-purpose lockd include file.
- *
* Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
*/
-#ifndef LINUX_LOCKD_LOCKD_H
-#define LINUX_LOCKD_LOCKD_H
-
-/* XXX: a lot of this should really be under fs/lockd. */
+#ifndef _LOCKD_LOCKD_H
+#define _LOCKD_LOCKD_H
#include <linux/exportfs.h>
#include <linux/in.h>
@@ -385,4 +379,4 @@ static inline int nlm_compare_locks(const struct file_lock *fl1,
extern const struct lock_manager_operations nlmsvc_lock_operations;
-#endif /* LINUX_LOCKD_LOCKD_H */
+#endif /* _LOCKD_LOCKD_H */
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index b8fc732e1c67..3d3ee88ca4dc 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -16,10 +16,10 @@
#include <linux/sunrpc/addr.h>
#include <linux/sunrpc/xprtsock.h>
#include <linux/sunrpc/svc.h>
-#include <linux/lockd/lockd.h>
#include <linux/unaligned.h>
+#include "lockd.h"
#include "netns.h"
#define NLMDBG_FACILITY NLMDBG_MONITOR
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index d68afa196535..fa57842ada71 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -36,9 +36,9 @@
#include <net/ip.h>
#include <net/addrconf.h>
#include <net/ipv6.h>
-#include <linux/lockd/lockd.h>
#include <linux/nfs.h>
+#include "lockd.h"
#include "netns.h"
#include "procfs.h"
#include "netlink.h"
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 73e6a2d5dba1..b6d1dcddd8a6 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -10,9 +10,9 @@
#include <linux/types.h>
#include <linux/time.h>
-#include <linux/lockd/lockd.h>
#include <linux/sunrpc/svc_xprt.h>
+#include "lockd.h"
#include "share.h"
#include "xdr4.h"
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 658294528324..d64326e9e95e 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -29,7 +29,8 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc_xprt.h>
#include <linux/lockd/nlm.h>
-#include <linux/lockd/lockd.h>
+
+#include "lockd.h"
#include "xdr4.h"
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index b32014ab6b88..0e1ac985c757 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -10,9 +10,9 @@
#include <linux/types.h>
#include <linux/time.h>
-#include <linux/lockd/lockd.h>
#include <linux/sunrpc/svc_xprt.h>
+#include "lockd.h"
#include "share.h"
#include "xdr4.h"
diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c
index 8e06840834c6..8675ac80ab16 100644
--- a/fs/lockd/svcshare.c
+++ b/fs/lockd/svcshare.c
@@ -14,8 +14,8 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
-#include <linux/lockd/lockd.h>
+#include "lockd.h"
#include "share.h"
static inline int
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index f0bc78217583..6480c2df8df3 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -15,11 +15,11 @@
#include <linux/mutex.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/addr.h>
-#include <linux/lockd/lockd.h>
#include <linux/module.h>
#include <linux/mount.h>
#include <uapi/linux/nfs2.h>
+#include "lockd.h"
#include "share.h"
#include "xdr4.h"
diff --git a/fs/lockd/trace.h b/fs/lockd/trace.h
index 7461b13b6e74..7214d7e96a42 100644
--- a/fs/lockd/trace.h
+++ b/fs/lockd/trace.h
@@ -8,7 +8,8 @@
#include <linux/tracepoint.h>
#include <linux/crc32.h>
#include <linux/nfs.h>
-#include <linux/lockd/lockd.h>
+
+#include "lockd.h"
#ifdef CONFIG_LOCKD_V4
#define NLM_STATUS_LIST \
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index adfcce2bf11b..5aac49d1875a 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -15,13 +15,12 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/stats.h>
-#include <linux/lockd/lockd.h>
#include <uapi/linux/nfs2.h>
+#include "lockd.h"
#include "svcxdr.h"
-
static inline loff_t
s32_to_loff_t(__s32 offset)
{
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index 5b1e15977697..f57d4881d5f1 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -16,8 +16,8 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/stats.h>
-#include <linux/lockd/lockd.h>
+#include "lockd.h"
#include "svcxdr.h"
#include "xdr4.h"
--
2.52.0
next prev parent reply other threads:[~2025-12-18 20:13 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 20:13 [PATCH v1 00/36] Clarify module API boundaries Chuck Lever
2025-12-18 20:13 ` [PATCH v1 01/36] lockd: Have nlm_fopen() return errno values Chuck Lever
2025-12-18 20:13 ` [PATCH v1 02/36] lockd: Relocate nlmsvc_unlock API declarations Chuck Lever
2025-12-18 20:13 ` [PATCH v1 03/36] NFS: Use nlmclnt_rpc_clnt() helper to retrieve nlm_host's rpc_clnt Chuck Lever
2025-12-18 20:13 ` [PATCH v1 04/36] lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/ Chuck Lever
2025-12-18 20:13 ` [PATCH v1 05/36] lockd: Move share.h " Chuck Lever
2025-12-18 20:13 ` Chuck Lever [this message]
2025-12-18 20:13 ` [PATCH v1 07/36] lockd: Remove lockd/debug.h Chuck Lever
2025-12-18 20:13 ` [PATCH v1 08/36] lockd: Move xdr.h from include/linux/lockd/ to fs/lockd/ Chuck Lever
2025-12-18 20:13 ` [PATCH v1 09/36] Documentation: Add the RPC language description of NLM version 4 Chuck Lever
2025-12-18 20:13 ` [PATCH v1 10/36] lockd: Use xdrgen XDR functions for the NLMv4 NULL procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 11/36] lockd: Use xdrgen XDR functions for the NLMv4 TEST procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 12/36] lockd: Use xdrgen XDR functions for the NLMv4 LOCK procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 13/36] lockd: Use xdrgen XDR functions for the NLMv4 CANCEL procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 14/36] lockd: Use xdrgen XDR functions for the NLMv4 UNLOCK procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 15/36] lockd: Use xdrgen XDR functions for the NLMv4 GRANTED procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 16/36] lockd: Refactor nlm4svc_callback() Chuck Lever
2025-12-18 20:13 ` [PATCH v1 17/36] lockd: Use xdrgen XDR functions for the NLMv4 TEST_MSG procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 18/36] lockd: Use xdrgen XDR functions for the NLMv4 LOCK_MSG procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 19/36] lockd: Use xdrgen XDR functions for the NLMv4 CANCEL_MSG procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 20/36] lockd: Use xdrgen XDR functions for the NLMv4 UNLOCK_MSG procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 21/36] lockd: Use xdrgen XDR functions for the NLMv4 GRANTED_MSG procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 22/36] lockd: Convert server-side NLMPROC4_TEST_RES to use xdrgen Chuck Lever
2025-12-18 20:13 ` [PATCH v1 23/36] lockd: Convert server-side NLMPROC4_LOCK_RES " Chuck Lever
2025-12-18 20:13 ` [PATCH v1 24/36] lockd: Convert server-side NLMPROC4_CANCEL_RES " Chuck Lever
2025-12-18 20:13 ` [PATCH v1 25/36] lockd: Convert server-side NLMPROC4_UNLOCK_RES " Chuck Lever
2025-12-18 20:13 ` [PATCH v1 26/36] lockd: Convert server-side NLMPROC4_GRANTED_RES " Chuck Lever
2025-12-18 20:13 ` [PATCH v1 27/36] lockd: Use xdrgen XDR functions for the NLMv4 SM_NOTIFY procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 28/36] lockd: Convert server-side undefined procedures to xdrgen Chuck Lever
2025-12-18 20:13 ` [PATCH v1 29/36] lockd: Hoist file_lock init out of nlm4svc_decode_shareargs() Chuck Lever
2025-12-18 20:13 ` [PATCH v1 30/36] lockd: Update share_file helpers Chuck Lever
2025-12-18 20:13 ` [PATCH v1 31/36] lockd: Use xdrgen XDR functions for the NLMv4 SHARE procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 32/36] lockd: Use xdrgen XDR functions for the NLMv4 UNSHARE procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 33/36] lockd: Use xdrgen XDR functions for the NLMv4 NM_LOCK procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 34/36] lockd: Use xdrgen XDR functions for the NLMv4 FREE_ALL procedure Chuck Lever
2025-12-18 20:13 ` [PATCH v1 35/36] lockd: Remove utilities that are no longer used Chuck Lever
2025-12-19 14:47 ` Jeff Layton
2025-12-18 20:13 ` [PATCH v1 36/36] lockd: Remove dead code from fs/lockd/xdr4.c Chuck Lever
2025-12-19 14:51 ` [PATCH v1 00/36] Clarify module API boundaries Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251218201346.1190928-7-cel@kernel.org \
--to=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).