git: 5e5a2ef8585d - stable/12 - buf: Add sysctl flag CTLFLAG_TUN to loader tunable

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Thu, 12 Oct 2023 05:11:02 UTC
The branch stable/12 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=5e5a2ef8585da72cbdf192016c9e3d02d047cbe0

commit 5e5a2ef8585da72cbdf192016c9e3d02d047cbe0
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-10-09 10:30:22 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-10-12 05:09:31 +0000

    buf: Add sysctl flag CTLFLAG_TUN to loader tunable
    
    The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader
    tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
    report it correctly.
    
    No functional change intended.
    
    Reviewed by:    kib, imp
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D42113
    
    (cherry picked from commit 31b94065300a76e52c26b8caec7256574d64a777)
    (cherry picked from commit 8c4eaac1534e0486bd0fc6816ccb59fc348a5707)
    (cherry picked from commit 5184476107f7dfcbc9931a94a91f16c71915bbd9)
---
 sys/kern/vfs_bio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index b1cc595d2887..47a663c5c50d 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -310,7 +310,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, &notbufdflushes,
 static long barrierwrites;
 SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW, &barrierwrites, 0,
     "Number of barrier writes");
-SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD,
+SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed,
+    CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
     &unmapped_buf_allowed, 0,
     "Permit the use of the unmapped i/o");
 int maxbcachebuf = MAXBCACHEBUF;