mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
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
This commit is contained in:
parent
baacf70137
commit
c804c8f2c5
@ -383,7 +383,7 @@ sbuf_set_drain(struct sbuf *s, sbuf_drain_func *func, void *ctx)
|
||||
/*
|
||||
* Call the drain and process the return.
|
||||
*/
|
||||
static int
|
||||
int
|
||||
sbuf_drain(struct sbuf *s)
|
||||
{
|
||||
int len;
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user