sys/vfs/hammer: Add hammer_btree_extract_leaf()
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 15:05:10 +0000 (00:05 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 5 Mar 2016 07:59:11 +0000 (16:59 +0900)
commitc11c58774d9abe6d70c7278bf4c013adee93e9b3
tree986920963c9fa2cc5531f3befa991e665ef6d13b
parent2d7e662fe7a645599757bf93ef1b46168f9202e7
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.
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_ioctl.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_prune.c