Page MenuHomeFreeBSD

Make sbuf_drain safe for external use

Authored by rscheff on Apr 2 2021, 8:12 AM.



While sbuf_drain was an internal function, two
KASSERTS checked the sanity of it being called.
However, an external caller may be ignorant if
there is any data to drain, or if an error has
already accumulated. Be nice and return immediately
with the accumulated error.

MFC after: 2 weeks

Diff Detail

rS FreeBSD src repository - subversion
Lint OK
No Unit Test Coverage
Build Status
Buildable 38266
Build 35155: arc lint + arc unit

Event Timeline

I would separate the changes:

  1. Remove some constraints when sbuf_drain() is called.
  2. Simplify a user of sbuf_drain().
  • only the subr_sbuf.c changes
This revision is now accepted and ready to land.Apr 2 2021, 12:53 PM
This revision was automatically updated to reflect the committed changes.