Bug #2823 » revertsysctlsmp.diff
sys/kern/kern_sysctl.c | ||
---|---|---|
/*
|
||
* Finish initialization from sysctl_set or add.
|
||
*/
|
||
lockinit(&oidp->oid_lock, "oidlk", 0, LK_CANRECURSE);
|
||
/* lockinit(&oidp->oid_lock, "oidlk", 0, LK_CANRECURSE); */
|
||
/*
|
||
* First check if another oid with the same name already
|
||
... | ... | |
kfree(__DECONST(char *, oidp->oid_descr),
|
||
M_SYSCTLOID);
|
||
kfree(__DECONST(char *, oidp->oid_name), M_SYSCTLOID);
|
||
lockuninit(&oidp->oid_lock);
|
||
/* lockuninit(&oidp->oid_lock); */
|
||
kfree(oidp, M_SYSCTLOID);
|
||
}
|
||
}
|
||
... | ... | |
error = priv_check(req->td, PRIV_SYSCTL_DEBUG);
|
||
if (error)
|
||
return (error);
|
||
SYSCTL_XLOCK();
|
||
sysctl_sysctl_debug_dump_node(&sysctl__children, 0);
|
||
SYSCTL_XUNLOCK();
|
||
return (ENOENT);
|
||
}
|
||
... | ... | |
struct sysctl_oid_list *lsp = &sysctl__children, *lsp2;
|
||
char buf[10];
|
||
SYSCTL_XLOCK();
|
||
while (namelen) {
|
||
if (!lsp) {
|
||
ksnprintf(buf, sizeof(buf), "%d", *name);
|
||
... | ... | |
}
|
||
error = SYSCTL_OUT(req, "", 1);
|
||
out:
|
||
SYSCTL_XUNLOCK();
|
||
return (error);
|
||
}
|
||
... | ... | |
req.lock = REQ_UNWIRED;
|
||
#endif
|
||
SYSCTL_SLOCK();
|
||
SYSCTL_XLOCK();
|
||
error = sysctl_root(0, name, namelen, &req);
|
||
SYSCTL_SUNLOCK();
|
||
SYSCTL_XUNLOCK();
|
||
#if 0
|
||
if (req.lock == REQ_WIRED && req.validlen > 0)
|
||
... | ... | |
lktype = LK_SHARED;
|
||
if (oid->oid_kind & CTLFLAG_EXLOCK)
|
||
lktype = LK_EXCLUSIVE;
|
||
lockmgr(&oid->oid_lock, lktype);
|
||
/* lockmgr(&oid->oid_lock, lktype); */
|
||
if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE)
|
||
error = oid->oid_handler(oid, (int *)arg1 + indx, arg2 - indx,
|
||
... | ... | |
else
|
||
error = oid->oid_handler(oid, oid->oid_arg1, oid->oid_arg2,
|
||
req);
|
||
lockmgr(&oid->oid_lock, LK_RELEASE);
|
||
/* lockmgr(&oid->oid_lock, LK_RELEASE); */
|
||
return (error);
|
||
}
|
||
... | ... | |
for (;;) {
|
||
req.oldidx = 0;
|
||
req.newidx = 0;
|
||
SYSCTL_SLOCK();
|
||
SYSCTL_XLOCK();
|
||
error = sysctl_root(0, name, namelen, &req);
|
||
SYSCTL_SUNLOCK();
|
||
SYSCTL_XUNLOCK();
|
||
if (error != EAGAIN)
|
||
break;
|
||
lwkt_yield();
|
sys/sys/sysctl.h | ||
---|---|---|
int oid_refcnt;
|
||
u_int oid_running;
|
||
const char *oid_descr;
|
||
struct lock oid_lock; /* per-node lock */
|
||
/* struct lock oid_lock; */ /* per-node lock */
|
||
};
|
||
#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
|