git: 2c5bfa8b8c6b - stable/13 - Require INVARIANTS and WITNESS if DEBUG_VFS_LOCKS is set

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 22 Jan 2023 09:19:16 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=2c5bfa8b8c6b8ed0a988b0137725813430b478d6

commit 2c5bfa8b8c6b8ed0a988b0137725813430b478d6
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-01-15 21:33:10 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-01-22 09:18:09 +0000

    Require INVARIANTS and WITNESS if DEBUG_VFS_LOCKS is set
    
    Tested by:      pho
    
    (cherry picked from commit 0f80d5ebc898f487067a3f2232f9ab0a7b291277)
---
 sys/kern/vfs_subr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index ca2d86385f4c..81bad2da0f0c 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -99,6 +99,10 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_kern.h>
 #include <vm/uma.h>
 
+#if defined(DEBUG_VFS_LOCKS) && (!defined(INVARIANTS) || !defined(WITNESS))
+#error DEBUG_VFS_LOCKS requires INVARIANTS and WITNESS
+#endif
+
 #ifdef DDB
 #include <ddb/ddb.h>
 #endif