History log of /fs/nilfs2/btree.c
Revision Date Author Comments
d40990537c9ea85dfe75dbe0ffba5e1002dfdf3f 25-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: fix missing block address termination in btree node shrinking

nilfs_btree_delete function does not terminate part of virtual block
addresses when shrinking the last remaining child node into the root
node. The missing address termination causes that dead btree node
blocks persist and chip away free disk space.

This fixes the leak bug on the btree node deletion.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fe744fdb74f2417d8571faefa45f72b0ead25f89 25-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: fix incorrect block address termination in node concatenation

nilfs_btree_delete function wrongly terminates virtual block address
of the btree node held by its parent at index 0. When concatenating
the index-0 node with its right sibling node, nilfs_btree_delete
terminates the block address of index-0 node instead of the right
sibling node which should be deleted.

This bug not only wears disk space in the long run, but also causes
file system corruption. This will fix it.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
5fc7b14177b1a1c2f2511aed62a4ca870d0332e7 04-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: use mark_buffer_dirty to mark btnode or meta data dirty

This replaces nilfs_mdt_mark_buffer_dirty and nilfs_btnode_mark_dirty
macros with mark_buffer_dirty and gets rid of nilfs_mark_buffer_dirty,
an own mark buffer dirty function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
be667377a8b8cd73e1b923f33fb5be4034aa4bfa 04-Mar-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: record used amount of each checkpoint in checkpoint list

This records the number of used blocks per checkpoint in each
checkpoint entry of cpfile. Even though userland tools can get the
block count via nilfs_get_cpinfo ioctl, it was not updated by the
nilfs2 kernel code. This fixes the issue and makes it available for
userland tools to calculate used amount per checkpoint.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Jiro SEKIBA <jir@unicus.jp>
03bdb5ac58a2144dfe8cfd73347fdb9f57e2e062 18-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: apply read-ahead for nilfs_btree_lookup_contig

This applies read-ahead to nilfs_btree_do_lookup and
nilfs_btree_lookup_contig functions and extends them to read ahead
siblings of level 1 btree nodes that hold data blocks.

At present, the read-ahead is not applied to most btree operations;
only get_block() callback function, which is used during read of
regular files or directories, receives the benefit.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
4e13e66bee2d792c1aae21797f16c181024834eb 18-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: introduce check flag to btree node buffer

nilfs_btree_get_block() now may return untested buffer due to
read-ahead. This adds a new flag for buffer heads so that the btree
code can check whether the buffer is already verified or not.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
464ece88630d0fb715ca942eabb1da825046a534 18-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add btree get block function with readahead option

This adds __nilfs_btree_get_block() function that can issue a series
of read-ahead requests for sibling btree nodes.

This read-ahead needs parent node block, so nilfs_btree_readahead_info
structure is added to pass the information that
__nilfs_btree_get_block() needs.

This also replaces the previous nilfs_btree_get_block() implementation
with a wrapper function of __nilfs_btree_get_block().

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
26dfdd8e29f28c08aa67861b3c83d0f3f7d30cee 18-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add read ahead mode to nilfs_btnode_submit_block

This adds mode argument to nilfs_btnode_submit_block() function and
allows it to issue a read-ahead request.

An optional submit_ptr argument is also added to store the actual
block address for which bio is sent. submit_ptr is used for a series
of read-ahead requests, and helps to decide if each requested block is
continous to the previous one on disk.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
7c397a81fe90c0445df2873700d14e82cca5fbc8 13-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: eliminate inline keywords in btree implementation

This removes all inline uses from btree.c. Gcc now agressively apply
inline expansion even for the functions declared without the keyword;
the inline use in btree.c looks excessive.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
5ad2686e9266f24a0bb76b01d5c3ae29b4e149fe 13-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: get maximum number of child nodes from bmap object

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 call.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
9b7b265c9ab67fcd1245d6b64fa5ca2eda43ac88 13-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> 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>
ea64ab87cdba9e1172392d247e6526359e301f12 13-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: optimize calculation of min/max number of btree node children

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.

This unfold these functions depending on context and move them outside
loops wherever possible.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
364ec2d700223b965620ff4d5031a3665d195873 13-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove redundant pointer checks in bmap lookup functions

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.ryusuke@lab.ntt.co.jp>
dc935be2a094087bc561d80f8cf9e66bbc1f7b18 10-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: unify bmap set_target_v operations

This unifies two similar functions nilfs_btree_set_target_v and
nilfs_direct_set_target_v into one, nilfs_bmap_set_target_v.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
e7c274f8083793f8f861def63c02a0839b34d26d 10-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: get rid of nilfs_btree uses

This replaces all uses of nilfs_btree struct in implementation of
btree mapping with nilfs_bmap struct.

Name of local variable "btree" is kept not to bloat amount of change.
And, a part of local variables "bmap" is renamed to "btree" to uniform
naming rule.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
583ada4761e18bb105ce5181b0b13cf55ead6201 10-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove constant qualifier from argument of bmap propagate

The first argument of bops->bop_propagate operation takes a constant
qualifier, and causes compilation error when removed cast to pointer
of nilfs_btree structure type. This fixes the issue to prepare for
succesive removal of nilfs_btree struct.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
25b8d7ded0e4579bf152882249abfd351e65a17d 10-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: get rid of private conversion macros on bmap key and pointer

Will remove nilfs_bmap_key_to_dkey(), nilfs_bmap_dkey_to_key(),
nilfs_bmap_ptr_to_dptr(), and nilfs_bmap_dptr_to_ptr() for simplicity.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1d5385b9f30ae43209459db424416a3e1d8f2bde 16-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: verify btree node after reading

This inserts sanity checks soon after read btree node from disk. This
allows early detection of broken btree nodes, and helps to narrow down
problems due to file system corruption.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
cfa913a5077f7619869b2b4d1bf23ccb4f8b3d7b 07-Jul-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add sanity check in nilfs_btree_add_dirty_buffer

According to the report titled "problem with nilfs_cleanerd" from
Łukasz Wójcicki, nilfs_btree_lookup_dirty_buffers or
nilfs_btree_add_dirty_buffer got memory violation during garbage
collection.

This could happen if a level field of given btree node buffer is
incorrect, which is a crucial internal bug.

This inserts a sanity check to figure out the problem.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
41c88bd74d372db5102996a4ea6167a725c24b5e 05-Apr-2010 Li Hong <lihong.hi@gmail.com> nilfs2: cleanup multi kmem_cache_{create,destroy} code

This cleanup patch gives several improvements:

- Moving all kmem_cache_{create_destroy} calls into one place, which removes
some small function calls, cleans up error check code and clarify the logic.

- Mark all initial code in __init section.

- Remove some very obvious comments.

- Adjust some declarations.

- Fix some space-tab issues.

Signed-off-by: Li Hong <lihong.hi@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
73bb48869b14fd5094b9ec173a2bf86bc0e464d4 02-Apr-2010 Li Hong <lihong.hi@gmail.com> nilfs2: Combine nilfs_btree_release_path() and nilfs_btree_free_path()

nilfs_btree_release_path() and nilfs_btree_free_path() are bound into each other
tightly. Make them into one procedure to clearify the logic and avoid some
misusages.

Signed-off-by: Li Hong <lihong.hi@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
f905440f5edfa70a07e64bdbc973cbdd55dd001d 02-Apr-2010 Li Hong <lihong.hi@gmail.com> nilfs2: Combine nilfs_btree_alloc_path() and nilfs_btree_init_path()

nilfs_btree_alloc_path() and nilfs_btree_init_path() are bound into each other
tightly. Make them into one procedure to clearify the logic and avoid some
misusages.

Signed-off-by: Li Hong <lihong.hi@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
308f44193f796b1c522b3b87760e43d8d8e316d2 02-Apr-2010 Li Hong <lihong.hi@gmail.com> nilfs2: Remove an uninitialization warning in nilfs_btree_propagate_v()

`make CONFIG_NILFS2_FS=m M=fs/nilfs2/` will give the following warnings:

fs/nilfs2/btree.c: In function 'nilfs_btree_propagate':
fs/nilfs2/btree.c:1882: warning: 'maxlevel' may be used uninitialized in this function
fs/nilfs2/btree.c:1882: note: 'maxlevel' was declared here

Set maxlevel = 0 to fix it.

Signed-off-by: Li Hong <lihong.hi@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
0935db747739782fc779eb58529610c12db88ea2 28-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: use list_splice_tail or list_splice_tail_init

This applies list_splice_tail (or list_splice_tail_init) operation
instead of list_splice (or list_splice_init, respectively) to append a
new list to tail of an existing list.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1376e931b75f954057b1547ba25fcba594cef804 13-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: eliminate nilfs_btnode_get function

This removes the obsolete nilfs_btnode_get() function and makes
nilfs_btree_get_block() directly call nilfs_btnode_submit_block().

This expansion will provide better opportunity for code optimization.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
45f4910bc0bb904bcf53aa04ee1b807abe1387a6 13-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: use nilfs_btnode_create_block function

This displaces nilfs_btnode_get() use to create new btree node block
with nilfs_btnode_create_block.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
30db4e6c3d51a89e4923e525303f714e6508bbd0 11-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove buffer locking from btree code

lock_buffer() and unlock_buffer() uses in btree.c are eliminable
because btree functions gain buffer heads through nilfs_btnode_get(),
which never returns an on-the-fly buffer.

Although nilfs_clear_dirty_page() and nilfs_copy_back_pages() in
nilfs_commit_gcdat_inode() juggle btree node buffers of DAT, this is
safe because these operations are protected by a log writer lock or
the metadata file semaphore of DAT.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
9b945d537db86557e5b5820b4b52df94c35b3829 10-Oct-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: get rid of BUG_ON use in btree lookup routines

The current btree lookup routines make a kernel oops when detected
inconsistency in btree blocks. These routines should instead return a
proper error code because the inconsistency usually comes from
corruption of on-disk metadata.

This fixes the issue by converting BUG_ON calls to proper error
handlings.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
2e0c2c73923fed27337039ddfd69985e6c4b91fe 15-Aug-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: allow btree code to directly call dat operations

The current btree code is written so that btree functions call dat
operations via wrapper functions in bmap.c when they allocate, free,
or modify virtual block addresses.

This abstraction requires additional function calls and causes
frequent call of nilfs_bmap_get_dat() function since it is used in the
every wrapper function.

This removes the wrapper functions and makes them available from
btree.c and direct.c, which will increase the opportunity of
compiler optimization.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
3218929dbd25245e0f601df1e359a3ed3f7fb03b 14-Aug-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: stop zero-fill of btree path just before free it

The btree path object is cleared just before it is freed.

This will remove the code doing the unnecessary clear operation.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
6d28f7ea43856449ed2f344cb209af3ba1c6b757 14-Aug-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove unused btree argument from btree functions

Even though many btree functions take a btree object as their first
argument, most of them are not used in their functions.

This sticky use of the btree argument is hurting code readability and
giving the possibility of inefficient code generation.

So, this removes the unnecessary btree arguments.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
c3a7abf06ce719a51139e62a034590be99abbc2c 24-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: support contiguous lookup of blocks

Although get_block() callback function can return extent of contiguous
blocks with bh->b_size, nilfs_get_block() function did not support
this feature.

This adds contiguous lookup feature to the block mapping codes of
nilfs, and allows the nilfs_get_blocks() function to return the extent
information by applying the feature.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
7cde31d7d6959b2c608aa6b200eb68892d3a6063 24-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove nilfs_btree_operations from btree mapping

will remove indirect function calls using nilfs_btree_operations
table.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
d4b961576df2769b936bd967b01e8c607c3c9ad8 23-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove bmap pointer operations

Previously, the bmap codes of nilfs used three types of function
tables. The abuse of indirect function calls decreased source
readability and suffered many indirect jumps which would confuse
branch prediction of processors.

This eliminates one type of the function tables,
nilfs_bmap_ptr_operations, which was used to dispatch low level
pointer operations of the nilfs bmap.

This adds a new integer variable "b_ptr_type" to nilfs_bmap struct,
and uses the value to select the pointer operations.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
3033342a0b76048e32ce1faebfa85cf8f1aa93b5 23-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove useless b_low and b_high fields from nilfs_bmap struct

This will cut off 16 bytes from the nilfs_bmap struct which is
embedded in the on-memory inode of nilfs.

The b_high field was never used, and the b_low field stores a constant
value which can be determined by whether the inode uses btree for
block mapping or not.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
e473c1f265f429427e09531435ceaf0fdbb86d15 21-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove pointless NULL check of bpop_commit_alloc_ptr function

This indirect function is set to NULL only for gc cache inodes, but
the gc cache inodes never call this function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
f198dbb9cf580c09644ebdf46846115c6daff14e 21-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: move get block functions in bmap.c into btree codes

Two get block function for btree nodes, nilfs_bmap_get_block() and
nilfs_bmap_get_new_block(), are called only from the btree codes.
This relocation will increase opportunities of compiler optimization.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
9f098900ad34edfe3bcc2498cfa372f588b96c62 21-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove nilfs_bmap_delete_block

nilfs_bmap_delete_block() is a wrapper function calling
nilfs_btnode_delete(). This removes it for simplicity.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
087d01b4253b611773ca81ad894486e7e17e74f6 21-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: remove nilfs_bmap_put_block

nilfs_bmap_put_block() is a wrapper function calling brelse(). This
eliminates the wrapper for simplicity.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
d97a51a7e3c298d9899ea91165dfa0783fa5cc5c 03-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: unify bmap operations starting use of indirect block address

This simplifies some low level functions of bmap.

Three bmap pointer operations, nilfs_bmap_start_v(),
nilfs_bmap_commit_v(), and nilfs_bmap_abort_v(), are unified into one
nilfs_bmap_start_v() function. And the related indirect function calls
are replaced with it.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1f5abe7e7dbcd83e73212c6cb135a6106cea6a0b 07-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: replace BUG_ON and BUG calls triggerable from ioctl

Pekka Enberg advised me:
> It would be nice if BUG(), BUG_ON(), and panic() calls would be
> converted to proper error handling using WARN_ON() calls. The BUG()
> call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
> triggerable from user-space via the ioctl() system call.

This will follow the comment and keep them to a minimum.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8acfbf0939e98cc77dab94c24899c9930ddd1e13 07-Apr-2009 Pekka Enberg <penberg@cs.helsinki.fi> nilfs2: clean up indirect function calling conventions

This cleans up the strange indirect function calling convention used in
nilfs to follow the normal kernel coding style.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17c76b0104e4a6513983777e1a17e0297a12b0c4 07-Apr-2009 Koji Sato <sato.koji@lab.ntt.co.jp> nilfs2: B-tree based block mapping

This adds declarations and functions of NILFS2 B-tree.

Two variants are integrated in the NILFS2 B-tree. The B-tree for the most
files points to the child nodes or data blocks with virtual block
addresses, whereas the B-tree of the DAT uses actual block addresses.

Signed-off-by: Koji Sato <sato.koji@lab.ntt.co.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>