From 2daaf63d538b76b6c135c273cc17c56fac5a7535 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 24 Jul 2025 15:30:15 +0000 Subject: [PATCH] mac: Remove uses of DEBUG_VFS_LOCKS We can assert that a vnode lock is held whenever INVARIANTS is configured. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51698 --- sys/security/mac/mac_framework.h | 2 +- sys/security/mac/mac_vfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h index 8e43f267f36..af827c33ee5 100644 --- a/sys/security/mac/mac_framework.h +++ b/sys/security/mac/mac_framework.h @@ -488,7 +488,7 @@ void mac_sysvshm_init(struct shmid_kernel *); void mac_thread_userret(struct thread *td); -#if defined(MAC) && defined(DEBUG_VFS_LOCKS) +#if defined(MAC) && defined(INVARIANTS) void mac_vnode_assert_locked(struct vnode *vp, const char *func); #else #define mac_vnode_assert_locked(vp, func) do { } while (0) diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c index a50c6f0c8f2..dc2bfa7c643 100644 --- a/sys/security/mac/mac_vfs.c +++ b/sys/security/mac/mac_vfs.c @@ -1078,7 +1078,7 @@ vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred) return (0); } -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS void mac_vnode_assert_locked(struct vnode *vp, const char *func) {