aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sbuf.h
diff options
context:
space:
mode:
authorRichard Scheffenegger <rscheff@FreeBSD.org>2021-03-31 16:25:53 +0000
committerRichard Scheffenegger <rscheff@FreeBSD.org>2021-03-31 17:17:37 +0000
commitc804c8f2c58ba42d476de07fbceff9ac4dd95f0e (patch)
tree74e2c1a8c17bc953ebec9a14a089a029ad58f3e9 /sys/sys/sbuf.h
parentbaacf701372bfeb3927c6b9e0b85d6eff198c6a3 (diff)
downloadsrc-c804c8f2c58ba42d476de07fbceff9ac4dd95f0e.tar.gz
src-c804c8f2c58ba42d476de07fbceff9ac4dd95f0e.zip
Export sbuf_drain to orchestrate lock and drain action
While exporting large amounts of data to a sysctl request, datastructures may need to be locked. Exporting the sbuf_drain function allows the coordination between drain events and held locks, to avoid stalls. PR: 254333 Reviewed By: jhb MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29481
Diffstat (limited to 'sys/sys/sbuf.h')
-rw-r--r--sys/sys/sbuf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index 10b59f360cd0..d87e3917b84c 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -95,6 +95,7 @@ int sbuf_vprintf(struct sbuf *, const char *, __va_list)
int sbuf_nl_terminate(struct sbuf *);
int sbuf_putc(struct sbuf *, int);
void sbuf_set_drain(struct sbuf *, sbuf_drain_func *, void *);
+int sbuf_drain(struct sbuf *);
int sbuf_trim(struct sbuf *);
int sbuf_error(const struct sbuf *);
int sbuf_finish(struct sbuf *);