summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2010-09-13 18:48:23 +0000
committermdf <mdf@FreeBSD.org>2010-09-13 18:48:23 +0000
commit3ed6eac561ccce2958e668867ea38fd005bc635b (patch)
treeb0bd953f5f99c28abddea5f8c7bb39d837607940 /sys/kern/kern_sysctl.c
parent9a10f7c4328c6763a33844ed9635ef3c2a7f1e84 (diff)
downloadFreeBSD-src-3ed6eac561ccce2958e668867ea38fd005bc635b.zip
FreeBSD-src-3ed6eac561ccce2958e668867ea38fd005bc635b.tar.gz
Revert r212370, as it causes a LOR on powerpc. powerpc does a few
unexpected things in copyout(9) and so wiring the user buffer is not sufficient to perform a copyout(9) while holding a random mutex. Requested by: nwhitehorn
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 49ccc50..b83502c 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
#include <sys/jail.h>
#include <sys/lock.h>
#include <sys/mutex.h>
-#include <sys/sbuf.h>
#include <sys/sx.h>
#include <sys/sysproto.h>
#include <sys/uio.h>
@@ -1545,30 +1544,3 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
}
return (error);
}
-
-/*
- * Drain into a sysctl struct. The user buffer must be wired.
- */
-static int
-sbuf_sysctl_drain(void *arg, const char *data, int len)
-{
- struct sysctl_req *req = arg;
- int error;
-
- error = SYSCTL_OUT(req, data, len);
- KASSERT(error >= 0, ("Got unexpected negative value %d", error));
- return (error == 0 ? len : -error);
-}
-
-struct sbuf *
-sbuf_new_for_sysctl(struct sbuf *s, char *buf, int length,
- struct sysctl_req *req)
-{
-
- /* Wire the user buffer, so we can write without blocking. */
- sysctl_wire_old_buffer(req, 0);
-
- s = sbuf_new(s, buf, length, SBUF_FIXEDLEN);
- sbuf_set_drain(s, sbuf_sysctl_drain, req);
- return (s);
-}
OpenPOWER on IntegriCloud