[PATCH 1/5] nilfs2: remove redundant pointer checks in bmap lookup functions

2010-07-13 Thread Ryusuke Konishi
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 +-

[PATCH 0/5] nilfs2 btree tweaks

2010-07-13 Thread Ryusuke Konishi
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

[PATCH 4/5] nilfs2: get maximum number of child nodes from bmap object

2010-07-13 Thread Ryusuke Konishi
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

[PATCH 2/5] nilfs2: optimize calculation of min/max number of btree node children

2010-07-13 Thread Ryusuke Konishi
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.

[PATCH 3/5] nilfs2: reduce repetitive calculation of max number of child nodes

2010-07-13 Thread Ryusuke Konishi
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