Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_sbuf.c
Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | KASSERT(func == s->s_drain_func || s->s_len == 0, | ||||
("Cannot change drain to %p on non-empty sbuf %p", func, s)); | ("Cannot change drain to %p on non-empty sbuf %p", func, s)); | ||||
s->s_drain_func = func; | s->s_drain_func = func; | ||||
s->s_drain_arg = ctx; | s->s_drain_arg = ctx; | ||||
} | } | ||||
/* | /* | ||||
* Call the drain and process the return. | * Call the drain and process the return. | ||||
*/ | */ | ||||
static int | int | ||||
sbuf_drain(struct sbuf *s) | sbuf_drain(struct sbuf *s) | ||||
{ | { | ||||
int len; | int len; | ||||
KASSERT(s->s_len > 0, ("Shouldn't drain empty sbuf %p", s)); | KASSERT(s->s_len > 0, ("Shouldn't drain empty sbuf %p", s)); | ||||
KASSERT(s->s_error == 0, ("Called %s with error on %p", __func__, s)); | KASSERT(s->s_error == 0, ("Called %s with error on %p", __func__, s)); | ||||
if (SBUF_DODRAINTOEOR(s) && s->s_rec_off == 0) | if (SBUF_DODRAINTOEOR(s) && s->s_rec_off == 0) | ||||
▲ Show 20 Lines • Show All 556 Lines • Show Last 20 Lines |