git: fe27f1db5f0b - main - kern: Remove CTLFLAG_NEEDGIANT from some sysctls.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Sun, 26 Dec 2021 17:03:37 UTC
The branch main has been updated by mav:

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

commit fe27f1db5f0b67ad2681a35253f7c1a4dc9874f8
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-12-26 17:02:28 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-12-26 17:03:33 +0000

    kern: Remove CTLFLAG_NEEDGIANT from some sysctls.
    
    MFC after:      2 weeks
---
 sys/kern/kern_acct.c     | 2 +-
 sys/kern/kern_sendfile.c | 2 +-
 sys/kern/kern_sig.c      | 2 +-
 sys/kern/uipc_sockbuf.c  | 2 +-
 sys/kern/uipc_socket.c   | 6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 7a3ff1700b66..0a29be2dcedf 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -187,7 +187,7 @@ sysctl_acct_chkfreq(SYSCTL_HANDLER_ARGS)
 	return (0);
 }
 SYSCTL_PROC(_kern, OID_AUTO, acct_chkfreq,
-    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &acctchkfreq, 0,
+    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &acctchkfreq, 0,
     sysctl_acct_chkfreq, "I",
     "frequency for checking the free space");
 
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index fb5258e31f35..30383490ca41 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -158,7 +158,7 @@ sfstat_sysctl(SYSCTL_HANDLER_ARGS)
 	return (SYSCTL_OUT(req, &s, sizeof(s)));
 }
 SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat,
-    CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0,
+    CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0,
     sfstat_sysctl, "I",
     "sendfile statistics");
 
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 4b036395f133..32fd2d2652d3 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -3560,7 +3560,7 @@ sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS)
 	return (0);
 }
 SYSCTL_PROC(_debug, OID_AUTO, ncores,
-    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int),
+    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(int),
     sysctl_debug_num_cores_check, "I",
     "Maximum number of generated process corefiles while using index format");
 
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index bb179043682e..d4db19598392 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -1784,7 +1784,7 @@ sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb)
 static int dummy;
 SYSCTL_INT(_kern, KERN_DUMMY, dummy, CTLFLAG_RW | CTLFLAG_SKIP, &dummy, 0, "");
 SYSCTL_OID(_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf,
-    CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sb_max, 0,
+    CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, &sb_max, 0,
     sysctl_handle_sb_max, "LU",
     "Maximum socket buffer size");
 SYSCTL_ULONG(_kern_ipc, KIPC_SOCKBUF_WASTE, sockbuf_waste_factor, CTLFLAG_RW,
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 6661b8f7b898..33dfe6cb2176 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -239,11 +239,11 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
 	return (0);
 }
 SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue,
-    CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int),
+    CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(int),
     sysctl_somaxconn, "I",
     "Maximum listen socket pending connection accept queue size");
 SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn,
-    CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, 0,
+    CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0,
     sizeof(int), sysctl_somaxconn, "I",
     "Maximum listen socket pending connection accept queue size (compat)");
 
@@ -375,7 +375,7 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS)
 	return (error);
 }
 SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets,
-    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &maxsockets, 0,
+    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &maxsockets, 0,
     sysctl_maxsockets, "IU",
     "Maximum number of sockets available");