mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04: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
(cherry picked from commit c804c8f2c5)
This commit is contained in:
parent
ddb7a5056f
commit
13d418a967
2 changed files with 2 additions and 1 deletions
|
|
@ -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 a new issue