From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neilb@ownmail.net>, 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 v3 12/14] lockd: Make linux/lockd/nlm.h an internal header
Date: Mon, 26 Jan 2026 14:55:33 -0500 [thread overview]
Message-ID: <20260126195535.154697-13-cel@kernel.org> (raw)
In-Reply-To: <20260126195535.154697-1-cel@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
The NLM protocol constants and status codes in nlm.h are needed
only by lockd's internal implementation. NFS client code and
NFSD interact with lockd through the stable API in bind.h and
have no direct use for protocol-level definitions.
Exposing these definitions globally via bind.h creates unnecessary
coupling between lockd internals and its consumers. Moving nlm.h
from include/linux/lockd/ to fs/lockd/ clarifies the API boundary:
bind.h provides the lockd service interface, while nlm.h remains
available only to code within fs/lockd/ that implements the
protocol.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/lockd/lockd.h | 1 +
{include/linux => fs}/lockd/nlm.h | 8 +++-----
fs/lockd/svclock.c | 1 -
include/linux/lockd/bind.h | 2 --
4 files changed, 4 insertions(+), 8 deletions(-)
rename {include/linux => fs}/lockd/nlm.h (91%)
diff --git a/fs/lockd/lockd.h b/fs/lockd/lockd.h
index 6f83b9a7257f..e73c6b348154 100644
--- a/fs/lockd/lockd.h
+++ b/fs/lockd/lockd.h
@@ -14,6 +14,7 @@
#include <linux/kref.h>
#include <linux/refcount.h>
#include <linux/utsname.h>
+#include "nlm.h"
#include <linux/lockd/bind.h>
#include "xdr.h"
#include <linux/sunrpc/debug.h>
diff --git a/include/linux/lockd/nlm.h b/fs/lockd/nlm.h
similarity index 91%
rename from include/linux/lockd/nlm.h
rename to fs/lockd/nlm.h
index 6e343ef760dc..47be65d0111f 100644
--- a/include/linux/lockd/nlm.h
+++ b/fs/lockd/nlm.h
@@ -1,14 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
- * linux/include/linux/lockd/nlm.h
- *
* Declarations for the Network Lock Manager protocol.
*
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
*/
-#ifndef LINUX_LOCKD_NLM_H
-#define LINUX_LOCKD_NLM_H
+#ifndef _LOCKD_NLM_H
+#define _LOCKD_NLM_H
/* Maximum file offset in file_lock.fl_end */
@@ -55,4 +53,4 @@ enum {
#define NLMPROC_NM_LOCK 22
#define NLMPROC_FREE_ALL 23
-#endif /* LINUX_LOCKD_NLM_H */
+#endif /* _LOCKD_NLM_H */
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 10e3937ad69f..572446113d35 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -28,7 +28,6 @@
#include <linux/sched.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc_xprt.h>
-#include <linux/lockd/nlm.h>
#include "lockd.h"
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 38d69fe8dfd5..4572e8958a81 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -10,8 +10,6 @@
#ifndef LINUX_LOCKD_BIND_H
#define LINUX_LOCKD_BIND_H
-#include <linux/lockd/nlm.h>
-
struct nfs_fh;
struct svc_rqst;
struct rpc_task;
--
2.52.0
next prev parent reply other threads:[~2026-01-26 19:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 19:55 [PATCH v3 00/14] Clarify module API boundaries Chuck Lever
2026-01-26 19:55 ` [PATCH v3 01/14] lockd: Simplify cast_status() in svcproc.c Chuck Lever
2026-01-26 19:55 ` [PATCH v3 02/14] lockd: Relocate and rename nlm_drop_reply Chuck Lever
2026-01-26 19:55 ` [PATCH v3 03/14] lockd: Introduce nlm__int__deadlock Chuck Lever
2026-01-26 19:55 ` [PATCH v3 04/14] lockd: Have nlm_fopen() return errno values Chuck Lever
2026-01-26 19:55 ` [PATCH v3 05/14] lockd: Relocate nlmsvc_unlock API declarations Chuck Lever
2026-01-26 19:55 ` [PATCH v3 06/14] NFS: Use nlmclnt_shutdown_rpc_clnt() to safely shut down NLM Chuck Lever
2026-01-26 19:55 ` [PATCH v3 07/14] lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/ Chuck Lever
2026-01-26 19:55 ` [PATCH v3 08/14] lockd: Move share.h " Chuck Lever
2026-01-26 19:55 ` [PATCH v3 09/14] lockd: Relocate include/linux/lockd/lockd.h Chuck Lever
2026-01-26 19:55 ` [PATCH v3 10/14] lockd: Remove lockd/debug.h Chuck Lever
2026-01-26 19:55 ` [PATCH v3 11/14] lockd: Move xdr.h from include/linux/lockd/ to fs/lockd/ Chuck Lever
2026-01-27 3:12 ` kernel test robot
2026-01-27 4:56 ` kernel test robot
2026-01-26 19:55 ` Chuck Lever [this message]
2026-01-26 19:55 ` [PATCH v3 13/14] lockd: Move nlm4svc_set_file_lock_range() Chuck Lever
2026-01-26 19:55 ` [PATCH v3 14/14] lockd: Relocate svc_version definitions to XDR layer Chuck Lever
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=20260126195535.154697-13-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=neilb@ownmail.net \
--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