]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Change the interactions of the interface functions with the "meta" and
authorAlan Cox <alc@FreeBSD.org>
Mon, 24 Jul 2017 17:23:53 +0000 (17:23 +0000)
committerAlan Cox <alc@FreeBSD.org>
Mon, 24 Jul 2017 17:23:53 +0000 (17:23 +0000)
commita396c83a5e3aeb42640dd9411f20161a8e128ae7
treecb2d8c933252170f4d293dae11eec462d2e463b2
parent6e5f5f90adbff72ec9fb36f453e584a0a6bbc225
Change the interactions of the interface functions with the "meta" and
"leaf" functions for alloc, free, and fill.  After the change, the interface
functions call "meta" unconditionally, and the "meta" functions recur
unconditionally in looping over their descendants. The "meta" functions
start with a validity test, and then a test for the "leaf" case, before
falling into the general recursive case.  This simplifies and shrinks the
code, and, for "free" and "fill" moves panic tests that check the same meta
node repeatedly in a loop to a place that will have each node tested once.

Remove irrelevant null checks from blist_free and blist_fill.

Make the code that initializes a meta node the same in blist_meta_alloc and
blist_meta_fill.

Parenthesize return expressions in blst_meta_fill.

Submitted by: Doug Moore <dougm@rice.edu>
MFC after: 1 week
sys/kern/subr_blist.c