git: 6adfee18effb - stable/14 - sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 15 May 2024 13:22:00 UTC
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=6adfee18effba91ff56341549a4e28473738316a

commit 6adfee18effba91ff56341549a4e28473738316a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-04-24 18:55:37 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-15 13:21:34 +0000

    sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c
    
    (cherry picked from commit 66df81021e5437e86ff5e0886c35170feb1cd3a0)
---
 sys/kern/vfs_lookup.c | 5 +++++
 sys/sys/namei.h       | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 600af6d486eb..f7fb986d4472 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -88,6 +88,11 @@ static void NDVALIDATE_impl(struct nameidata *, int);
 	ndp->ni_cnd.cn_flags |= ISRESTARTED;				\
 } while (0)
 
+#define	NI_CAP_VIOLATION(ndp, path)	do {			\
+	ktrcapfail(CAPFAIL_NAMEI, (path));			\
+	(ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS;			\
+} while (0)
+
 SDT_PROVIDER_DEFINE(vfs);
 SDT_PROBE_DEFINE4(vfs, namei, lookup, entry, "struct vnode *", "char *",
     "unsigned long", "bool");
diff --git a/sys/sys/namei.h b/sys/sys/namei.h
index d464423c025c..f6279700e735 100644
--- a/sys/sys/namei.h
+++ b/sys/sys/namei.h
@@ -205,11 +205,6 @@ int	cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status,
 #define	NI_LCF_CAP_DOTDOT_KTR	0x0008	/* ".." in strictrelative case */
 #define	NI_LCF_KTR_FLAGS	(NI_LCF_STRICTREL_KTR | NI_LCF_CAP_DOTDOT_KTR)
 
-#define	NI_CAP_VIOLATION(ndp, path)	do {			\
-	ktrcapfail(CAPFAIL_NAMEI, (path));			\
-	(ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS;			\
-} while (0)
-
 /*
  * Initialization of a nameidata structure.
  */