aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/bmap.h2
-rw-r--r--fs/nilfs2/btree.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/nilfs2/bmap.h b/fs/nilfs2/bmap.h
index fae83cf9c009..a20569b19929 100644
--- a/fs/nilfs2/bmap.h
+++ b/fs/nilfs2/bmap.h
@@ -105,6 +105,7 @@ static inline int nilfs_bmap_is_new_ptr(unsigned long ptr)
105 * @b_last_allocated_ptr: last allocated ptr for data block 105 * @b_last_allocated_ptr: last allocated ptr for data block
106 * @b_ptr_type: pointer type 106 * @b_ptr_type: pointer type
107 * @b_state: state 107 * @b_state: state
108 * @b_nchildren_per_block: maximum number of child nodes for non-root nodes
108 */ 109 */
109struct nilfs_bmap { 110struct nilfs_bmap {
110 union { 111 union {
@@ -118,6 +119,7 @@ struct nilfs_bmap {
118 __u64 b_last_allocated_ptr; 119 __u64 b_last_allocated_ptr;
119 int b_ptr_type; 120 int b_ptr_type;
120 int b_state; 121 int b_state;
122 __u16 b_nchildren_per_block;
121}; 123};
122 124
123/* pointer type */ 125/* pointer type */
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index 829e145f1353..7089d9041146 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -154,7 +154,7 @@ static inline int nilfs_btree_node_size(const struct nilfs_bmap *btree)
154 154
155static int nilfs_btree_nchildren_per_block(const struct nilfs_bmap *btree) 155static int nilfs_btree_nchildren_per_block(const struct nilfs_bmap *btree)
156{ 156{
157 return NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(btree)); 157 return btree->b_nchildren_per_block;
158} 158}
159 159
160static inline __le64 * 160static inline __le64 *
@@ -2218,10 +2218,14 @@ static const struct nilfs_bmap_operations nilfs_btree_ops_gc = {
2218int nilfs_btree_init(struct nilfs_bmap *bmap) 2218int nilfs_btree_init(struct nilfs_bmap *bmap)
2219{ 2219{
2220 bmap->b_ops = &nilfs_btree_ops; 2220 bmap->b_ops = &nilfs_btree_ops;
2221 bmap->b_nchildren_per_block =
2222 NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(bmap));
2221 return 0; 2223 return 0;
2222} 2224}
2223 2225
2224void nilfs_btree_init_gc(struct nilfs_bmap *bmap) 2226void nilfs_btree_init_gc(struct nilfs_bmap *bmap)
2225{ 2227{
2226 bmap->b_ops = &nilfs_btree_ops_gc; 2228 bmap->b_ops = &nilfs_btree_ops_gc;
2229 bmap->b_nchildren_per_block =
2230 NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(bmap));
2227} 2231}