Page MenuHomeFreeBSD

Make sbuf_drain safe for external use
ClosedPublic

Authored by rscheff on Apr 2 2021, 8:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 23, 7:56 AM
Unknown Object (File)
Sat, Jan 18, 5:51 PM
Unknown Object (File)
Sat, Jan 18, 5:18 PM
Unknown Object (File)
Fri, Jan 10, 5:07 PM
Unknown Object (File)
Nov 30 2024, 5:28 PM
Unknown Object (File)
Nov 30 2024, 5:07 PM
Unknown Object (File)
Nov 30 2024, 11:13 AM
Unknown Object (File)
Nov 27 2024, 5:13 AM
Subscribers

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.