git: 4f8eaa24a2ac - stable/13 - fd: Add sysctl flag CTLFLAG_TUN to loader tunables

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

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

commit 4f8eaa24a2ac40363ad13101a60ba3516a7ef401
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:19:37 +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)
    (cherry picked from commit d9aa723347825418c742164c3e9a77d1e4b6943d)
---
 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 dbf4ab1828de..de6bfe8bc1ae 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -5111,10 +5111,11 @@ DB_SHOW_COMMAND(files, db_show_files)
 }
 #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,