[Bug 223838] g_bio_clone vs g_bio_duplicate
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Nov 24 09:17:20 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223838
Bug ID: 223838
Summary: g_bio_clone vs g_bio_duplicate
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: kern
Assignee: freebsd-bugs at FreeBSD.org
Reporter: avg at FreeBSD.org
g_duplicate_bio() was introduced in base r159304:
> Add g_duplicate_bio() function which does the same thing what g_clone_bio()
> is doing, but g_duplicate_bio() allocates new bio with M_WAITOK flag.
Originally it was almost a complete duplicate (or a clone) of g_bio_clone
except for the M_NOWAIT vs M_MWAITOK difference.
But over the time some additional differences have accumulated. Among them
handling of bio_flags and geom schedulers.
It is very hard to tell which differences are intentional and which are not.
It would be nice to identify and remove the unintentional differences.
Also, it would be nice to move the common code into a helper function to avoid
the code duplication and the resulting unintentional divergence.
Finally, perhaps g_duplicate_bio() needs a better name while it is not very
widely used. "Duplicate" and "clone" are synonyms, so it's hard telling them
apart.
Some ideas: g_bio_reliable_clone, g_bio_clone_waitok.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list