git: sys/vfs/hammer: Add hammer_btree_extract_leaf()

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Mar 5 03:54:53 PST 2016


commit c11c58774d9abe6d70c7278bf4c013adee93e9b3
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Mon Feb 29 00:05:10 2016 +0900

    sys/vfs/hammer: Add hammer_btree_extract_leaf()
    
    hammer_btree_extract() doesn't read data from block devices
    unless flag has HAMMER_CURSOR_GET_DATA. It doesn't really matter
    if the flag is HAMMER_CURSOR_GET_LEAF or not in order to just
    extract the node element (without reading data) as long as the
    flag doesn't have HAMMER_CURSOR_GET_DATA. Calling this function
    will cause cursor->leaf to point to the node element in question
    regardless of the flag value.
    
    This commit adds hammer_btree_extract_leaf() which is just a
    wrapper over hammer_btree_extract(cursor, HAMMER_CURSOR_GET_LEAF).
    This hides complexity of using HAMMER_CURSOR_GET_LEAF or 0 or
    anything other than HAMMER_CURSOR_GET_DATA which are all the same.

Summary of changes:
 sys/vfs/hammer/hammer.h        |  8 ++++++++
 sys/vfs/hammer/hammer_btree.c  |  4 ++++
 sys/vfs/hammer/hammer_ioctl.c  |  4 ++--
 sys/vfs/hammer/hammer_object.c | 10 ++++------
 sys/vfs/hammer/hammer_prune.c  |  6 ++----
 5 files changed, 20 insertions(+), 12 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c11c58774d9abe6d70c7278bf4c013adee93e9b3


-- 
DragonFly BSD source repository



More information about the Commits mailing list