aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2024-04-24 18:55:37 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2024-04-24 19:43:31 +0000
commit66df81021e5437e86ff5e0886c35170feb1cd3a0 (patch)
treeb9eb6aec7039546a040d4fe8eebc414520ac441a
parent0135101e23f98205157928dc819ef3bc993a4276 (diff)
downloadsrc-66df81021e5437e86ff5e0886c35170feb1cd3a0.tar.gz
src-66df81021e5437e86ff5e0886c35170feb1cd3a0.zip
sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c
Reviewed by: emaste, imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44931
-rw-r--r--sys/kern/vfs_lookup.c5
-rw-r--r--sys/sys/namei.h5
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 7d708bac607e..180605f9eb8a 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -86,6 +86,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 08395c6d699f..2ea4f502e8fd 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.
*/