git: d9aa72334782 - stable/14 - fd: Add sysctl flag CTLFLAG_TUN to loader tunables

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Thu, 12 Oct 2023 04:09:56 UTC
The branch stable/14 has been updated by zlei:

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

commit d9aa723347825418c742164c3e9a77d1e4b6943d
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-10-09 10:30:21 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-10-12 04:08:19 +0000

    fd: Add sysctl flag CTLFLAG_TUN to loader tunables
    
    The following sysctl variables are actually loader tunables. Add sysctl
    flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.
    
     1. kern.maxfiles
     2. kern.maxfilesperproc
    
    No functional change intended.
    
    Reviewed by:    kib, imp
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D42113
    
    (cherry picked from commit 2af5ce5b5efb0cf6514acdc4a8b4058221641c39)
---
 sys/kern/kern_descrip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 35046c856d54..6ed824e229d6 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -5090,10 +5090,11 @@ DB_SHOW_COMMAND_FLAGS(files, db_show_files, DB_CMD_MEMSAFE)
 }
 #endif
 
-SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW,
+SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc,
+    CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
     &maxfilesperproc, 0, "Maximum files allowed open per process");
 
-SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW,
+SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
     &maxfiles, 0, "Maximum number of files");
 
 SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,