Ryusuke Konishi 9b7b265c9a nilfs2: reduce repetitive calculation of max number of child nodes
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 (ncmax) through their argument.

This changes parameter passing of the following functions:

 - nilfs_btree_node_dptrs
 - nilfs_btree_node_get_ptr
 - nilfs_btree_node_set_ptr
 - nilfs_btree_node_init
 - nilfs_btree_node_move_left
 - nilfs_btree_node_move_right
 - nilfs_btree_node_insert
 - nilfs_btree_node_delete, and
 - nilfs_btree_get_node

The following functions are removed:

 - nilfs_btree_node_nchildren_min
 - nilfs_btree_node_nchildren_max

Most middle level btree operations are rewritten to pass a proper
ncmax value depending on whether each occurrence of node is "root" or
not.

A constant NILFS_BTREE_ROOT_NCHILDREN_MAX is used for the root node,
whereas nilfs_btree_nchildren_per_block() function is used for
non-root nodes.  If a node could be either root or a non-root node, an
output argument of nilfs_btree_get_node() is used to set up ncmax.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
2010-07-23 10:02:14 +09:00
..
2010-07-23 10:02:14 +09:00
2010-07-23 10:02:14 +09:00
2009-12-25 13:01:50 +09:00
2010-03-14 10:29:51 +09:00
2010-07-23 10:02:14 +09:00
2010-05-27 22:05:02 -04:00
2010-07-23 10:02:14 +09:00
2009-11-20 10:05:50 +09:00
2009-04-07 08:31:16 -07:00
2010-07-23 10:02:14 +09:00
2010-07-23 10:02:14 +09:00
2009-04-07 08:31:13 -07:00
2009-06-11 21:36:18 -04:00
2010-03-14 10:29:51 +09:00
2010-07-23 10:02:14 +09:00