git: sys/vfs/hammer: Remove redundant elm type check [1/2]

Tomohiro Kusumi tkusumi at
Fri Sep 4 10:57:31 PDT 2015

commit 5cbc7d52036223c1bc23626d6e622d923887cbf5
Author: Tomohiro Kusumi <kusumi.tomohiro at>
Date:   Fri Aug 28 06:04:55 2015 +0900

    sys/vfs/hammer: Remove redundant elm type check [1/2]
    hammer_btree_lock_children() assumes the node is internal,
    but not leaf or anything else. Also given that all elms[]
    within a node has the same elm type (i.e. all elms[] use
    the same union member of hammer_btree_elm_t), this function
    doesn't need to check if each elms[i] is a node element
    of an internal node.
    If elms[] are not elements of an internal node, then the
    caller is not using this function right rather than this
    function missing sanity checks.
    In fact this is (only)used by hammer_split_internal() and
    reblock/rebalance code where they deal with internal nodes.
    They all do pass an internal node.

Summary of changes:
 sys/vfs/hammer/hammer_btree.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list