summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2011-01-26 22:48:09 +0000
committermdf <mdf@FreeBSD.org>2011-01-26 22:48:09 +0000
commit886222db75f8a2f0e19f97934a5375f602e0987a (patch)
treedc742eb9e182ac85c209a3f78894d2a19ad6bdd6 /sys/kern/kern_sysctl.c
parentb2f1af47a54d0b9f2e59480e33079d65d8af0931 (diff)
downloadFreeBSD-src-886222db75f8a2f0e19f97934a5375f602e0987a.zip
FreeBSD-src-886222db75f8a2f0e19f97934a5375f602e0987a.tar.gz
Remove the CTLFLAG_NOLOCK as it seems to be both unused and
unfunctional. Wiring the user buffer has only been done explicitly since r101422. Mark the kern.disks sysctl as MPSAFE since it is and it seems to have been mis-using the NOLOCK flag. Partially break the KPI (but not the KBI) for the sysctl_req 'lock' field since this member should be private and the "REQ_LOCKED" state seems meaningless now.
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 31d4a1e..7769a6d 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1206,7 +1206,7 @@ kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old,
req.oldfunc = sysctl_old_kernel;
req.newfunc = sysctl_new_kernel;
- req.lock = REQ_LOCKED;
+ req.lock = REQ_UNWIRED;
SYSCTL_XLOCK();
error = sysctl_root(0, name, namelen, &req);
@@ -1314,7 +1314,7 @@ sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
wiredlen = (len > 0 && len < req->oldlen) ? len : req->oldlen;
ret = 0;
- if (req->lock == REQ_LOCKED && req->oldptr &&
+ if (req->lock != REQ_WIRED && req->oldptr &&
req->oldfunc == sysctl_old_user) {
if (wiredlen != 0) {
ret = vslock(req->oldptr, wiredlen);
@@ -1350,8 +1350,6 @@ sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
return (ENOENT);
indx++;
- if (oid->oid_kind & CTLFLAG_NOLOCK)
- req->lock = REQ_UNLOCKED;
if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) {
if (oid->oid_handler != NULL || indx == namelen) {
*noid = oid;
@@ -1548,7 +1546,7 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
req.oldfunc = sysctl_old_user;
req.newfunc = sysctl_new_user;
- req.lock = REQ_LOCKED;
+ req.lock = REQ_UNWIRED;
#ifdef KTRACE
if (KTRPOINT(curthread, KTR_SYSCTL))
OpenPOWER on IntegriCloud