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)
Mon, Mar 25, 9:44 PM
Unknown Object (File)
Feb 6 2024, 8:29 PM
Unknown Object (File)
Dec 23 2023, 3:02 AM
Unknown Object (File)
Dec 13 2023, 8:39 AM
Unknown Object (File)
Nov 29 2023, 9:55 PM
Unknown Object (File)
Aug 28 2023, 5:34 PM
Unknown Object (File)
Aug 25 2023, 1:42 PM
Unknown Object (File)
Aug 16 2023, 9:52 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.