diff options
author | mdf <mdf@FreeBSD.org> | 2011-01-27 00:34:12 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2011-01-27 00:34:12 +0000 |
commit | 7fc649fc41274dcd3ffbed0d354a418b71e65786 (patch) | |
tree | e4eadeb1ff33d6db2e7b3001b1b8a9e9c21e2a2f /sys/kern/subr_lock.c | |
parent | 886222db75f8a2f0e19f97934a5375f602e0987a (diff) | |
download | FreeBSD-src-7fc649fc41274dcd3ffbed0d354a418b71e65786.zip FreeBSD-src-7fc649fc41274dcd3ffbed0d354a418b71e65786.tar.gz |
Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9). This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.
Inspired by: rwatson
Diffstat (limited to 'sys/kern/subr_lock.c')
-rw-r--r-- | sys/kern/subr_lock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index 25c1965..be9fa31 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -393,6 +393,9 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) int error, cpu, t; int enabled; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sb = sbuf_new_for_sysctl(NULL, NULL, LPROF_SBUF_SIZE, req); sbuf_printf(sb, "\n%8s %9s %11s %11s %11s %6s %6s %2s %6s %s\n", "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); |