Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 2017 09:17:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 223838] g_bio_clone vs g_bio_duplicate
Message-ID:  <bug-223838-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223838

            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@FreeBSD.org
          Reporter: avg@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 av=
oid
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 th=
em
apart.=20
Some ideas: g_bio_reliable_clone, g_bio_clone_waitok.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223838-8>