diff options
author | Li Hong <lihong.hi@gmail.com> | 2010-04-05 12:54:11 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-05-09 22:32:30 -0400 |
commit | 41c88bd74d372db5102996a4ea6167a725c24b5e (patch) | |
tree | 98b8e208d41f7760458e82569e297843415bbe7d /fs/nilfs2/btree.h | |
parent | aaed1d5bfac459ead9aaad324e7fe3326250f50a (diff) |
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>
Diffstat (limited to 'fs/nilfs2/btree.h')
-rw-r--r-- | fs/nilfs2/btree.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/fs/nilfs2/btree.h b/fs/nilfs2/btree.h index 4b82d84ade75..af638d59e3bf 100644 --- a/fs/nilfs2/btree.h +++ b/fs/nilfs2/btree.h | |||
@@ -30,9 +30,6 @@ | |||
30 | #include "btnode.h" | 30 | #include "btnode.h" |
31 | #include "bmap.h" | 31 | #include "bmap.h" |
32 | 32 | ||
33 | struct nilfs_btree; | ||
34 | struct nilfs_btree_path; | ||
35 | |||
36 | /** | 33 | /** |
37 | * struct nilfs_btree - B-tree structure | 34 | * struct nilfs_btree - B-tree structure |
38 | * @bt_bmap: bmap base structure | 35 | * @bt_bmap: bmap base structure |
@@ -41,6 +38,25 @@ struct nilfs_btree { | |||
41 | struct nilfs_bmap bt_bmap; | 38 | struct nilfs_bmap bt_bmap; |
42 | }; | 39 | }; |
43 | 40 | ||
41 | /** | ||
42 | * struct nilfs_btree_path - A path on which B-tree operations are executed | ||
43 | * @bp_bh: buffer head of node block | ||
44 | * @bp_sib_bh: buffer head of sibling node block | ||
45 | * @bp_index: index of child node | ||
46 | * @bp_oldreq: ptr end request for old ptr | ||
47 | * @bp_newreq: ptr alloc request for new ptr | ||
48 | * @bp_op: rebalance operation | ||
49 | */ | ||
50 | struct nilfs_btree_path { | ||
51 | struct buffer_head *bp_bh; | ||
52 | struct buffer_head *bp_sib_bh; | ||
53 | int bp_index; | ||
54 | union nilfs_bmap_ptr_req bp_oldreq; | ||
55 | union nilfs_bmap_ptr_req bp_newreq; | ||
56 | struct nilfs_btnode_chkey_ctxt bp_ctxt; | ||
57 | void (*bp_op)(struct nilfs_btree *, struct nilfs_btree_path *, | ||
58 | int, __u64 *, __u64 *); | ||
59 | }; | ||
44 | 60 | ||
45 | #define NILFS_BTREE_ROOT_SIZE NILFS_BMAP_SIZE | 61 | #define NILFS_BTREE_ROOT_SIZE NILFS_BMAP_SIZE |
46 | #define NILFS_BTREE_ROOT_NCHILDREN_MAX \ | 62 | #define NILFS_BTREE_ROOT_NCHILDREN_MAX \ |
@@ -57,6 +73,7 @@ struct nilfs_btree { | |||
57 | #define NILFS_BTREE_KEY_MIN ((__u64)0) | 73 | #define NILFS_BTREE_KEY_MIN ((__u64)0) |
58 | #define NILFS_BTREE_KEY_MAX (~(__u64)0) | 74 | #define NILFS_BTREE_KEY_MAX (~(__u64)0) |
59 | 75 | ||
76 | extern struct kmem_cache *nilfs_btree_path_cache; | ||
60 | 77 | ||
61 | int nilfs_btree_path_cache_init(void); | 78 | int nilfs_btree_path_cache_init(void); |
62 | void nilfs_btree_path_cache_destroy(void); | 79 | void nilfs_btree_path_cache_destroy(void); |