nilfs_bmap_lookup and its variants are supposed to take a valid
pointer argument to return a block address, thus pointer checks in
nilfs_btree_lookup and nilfs_direct_lookup are needless.
Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp
---
fs/nilfs2/btree.c |6 +-
This series gives additional refactoring and tweaks on the btree code.
The nilfs2: optimize calculation of min/max number of btree node
children and nilfs2: reduce repetitive calculation of max number of
child nodes and nilfs2: get maximum number of child nodes from bmap
object reduce repetitive
The patch reduce repetitive calculation of max number of child nodes
gathered up the calculation of maximum number of child nodes into
nilfs_btree_nchildren_per_block() function. This makes the function
get resultant value from a private variable in bmap object instead of
calculating it for each
nilfs_btree_node_nchildren_max() and nilfs_btree_node_nchildren_min()
functions switch return value depending on whether target node is the
root or a node block. In most uses of these functions, however, the
node type is fixed, and moreover the same calculation is repeatedly
performed in loop.
The current btree implementation repeats the same calculation on the
maximum number of child nodes. This is because a few low level
routines use the calculation for index addressing in a btree node
block.
This reduces the calculation by explicitly passing the maximum number
of child nodes