aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2009-02-13 06:09:54 -0500
committerJoel Becker <joel.becker@oracle.com>2009-09-04 19:08:07 -0400
commita29702914ad36443d83b5250b3bfa1bf91e6b239 (patch)
tree74937c792f6ff893dd108497119895127a16f053 /fs/ocfs2/alloc.c
parentb4a176515c715f0c6db1759a39cd9c4175e5a23a (diff)
ocfs2: Swap inode for extent_tree in ocfs2_figure_merge_contig_type().
We don't want struct inode in generic btree operations. Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r--fs/ocfs2/alloc.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 2431bbba6cd8..9b79150e478f 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -4312,7 +4312,8 @@ out:
4312} 4312}
4313 4313
4314static enum ocfs2_contig_type 4314static enum ocfs2_contig_type
4315ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path, 4315ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
4316 struct ocfs2_path *path,
4316 struct ocfs2_extent_list *el, int index, 4317 struct ocfs2_extent_list *el, int index,
4317 struct ocfs2_extent_rec *split_rec) 4318 struct ocfs2_extent_rec *split_rec)
4318{ 4319{
@@ -4324,12 +4325,12 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4324 struct ocfs2_path *left_path = NULL, *right_path = NULL; 4325 struct ocfs2_path *left_path = NULL, *right_path = NULL;
4325 struct buffer_head *bh; 4326 struct buffer_head *bh;
4326 struct ocfs2_extent_block *eb; 4327 struct ocfs2_extent_block *eb;
4328 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci);
4327 4329
4328 if (index > 0) { 4330 if (index > 0) {
4329 rec = &el->l_recs[index - 1]; 4331 rec = &el->l_recs[index - 1];
4330 } else if (path->p_tree_depth > 0) { 4332 } else if (path->p_tree_depth > 0) {
4331 status = ocfs2_find_cpos_for_left_leaf(inode->i_sb, 4333 status = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos);
4332 path, &left_cpos);
4333 if (status) 4334 if (status)
4334 goto out; 4335 goto out;
4335 4336
@@ -4338,8 +4339,8 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4338 if (!left_path) 4339 if (!left_path)
4339 goto out; 4340 goto out;
4340 4341
4341 status = ocfs2_find_path(INODE_CACHE(inode), 4342 status = ocfs2_find_path(et->et_ci, left_path,
4342 left_path, left_cpos); 4343 left_cpos);
4343 if (status) 4344 if (status)
4344 goto out; 4345 goto out;
4345 4346
@@ -4349,7 +4350,7 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4349 le16_to_cpu(new_el->l_count)) { 4350 le16_to_cpu(new_el->l_count)) {
4350 bh = path_leaf_bh(left_path); 4351 bh = path_leaf_bh(left_path);
4351 eb = (struct ocfs2_extent_block *)bh->b_data; 4352 eb = (struct ocfs2_extent_block *)bh->b_data;
4352 ocfs2_error(inode->i_sb, 4353 ocfs2_error(sb,
4353 "Extent block #%llu has an " 4354 "Extent block #%llu has an "
4354 "invalid l_next_free_rec of " 4355 "invalid l_next_free_rec of "
4355 "%d. It should have " 4356 "%d. It should have "
@@ -4374,7 +4375,7 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4374 if (split_rec->e_cpos == el->l_recs[index].e_cpos) 4375 if (split_rec->e_cpos == el->l_recs[index].e_cpos)
4375 ret = CONTIG_RIGHT; 4376 ret = CONTIG_RIGHT;
4376 } else { 4377 } else {
4377 ret = ocfs2_extent_contig(inode->i_sb, rec, split_rec); 4378 ret = ocfs2_extent_contig(sb, rec, split_rec);
4378 } 4379 }
4379 } 4380 }
4380 4381
@@ -4383,8 +4384,7 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4383 rec = &el->l_recs[index + 1]; 4384 rec = &el->l_recs[index + 1];
4384 else if (le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count) && 4385 else if (le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count) &&
4385 path->p_tree_depth > 0) { 4386 path->p_tree_depth > 0) {
4386 status = ocfs2_find_cpos_for_right_leaf(inode->i_sb, 4387 status = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos);
4387 path, &right_cpos);
4388 if (status) 4388 if (status)
4389 goto out; 4389 goto out;
4390 4390
@@ -4395,7 +4395,7 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4395 if (!right_path) 4395 if (!right_path)
4396 goto out; 4396 goto out;
4397 4397
4398 status = ocfs2_find_path(INODE_CACHE(inode), right_path, right_cpos); 4398 status = ocfs2_find_path(et->et_ci, right_path, right_cpos);
4399 if (status) 4399 if (status)
4400 goto out; 4400 goto out;
4401 4401
@@ -4405,7 +4405,7 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4405 if (le16_to_cpu(new_el->l_next_free_rec) <= 1) { 4405 if (le16_to_cpu(new_el->l_next_free_rec) <= 1) {
4406 bh = path_leaf_bh(right_path); 4406 bh = path_leaf_bh(right_path);
4407 eb = (struct ocfs2_extent_block *)bh->b_data; 4407 eb = (struct ocfs2_extent_block *)bh->b_data;
4408 ocfs2_error(inode->i_sb, 4408 ocfs2_error(sb,
4409 "Extent block #%llu has an " 4409 "Extent block #%llu has an "
4410 "invalid l_next_free_rec of %d", 4410 "invalid l_next_free_rec of %d",
4411 (unsigned long long)le64_to_cpu(eb->h_blkno), 4411 (unsigned long long)le64_to_cpu(eb->h_blkno),
@@ -4420,7 +4420,7 @@ ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
4420 if (rec) { 4420 if (rec) {
4421 enum ocfs2_contig_type contig_type; 4421 enum ocfs2_contig_type contig_type;
4422 4422
4423 contig_type = ocfs2_extent_contig(inode->i_sb, rec, split_rec); 4423 contig_type = ocfs2_extent_contig(sb, rec, split_rec);
4424 4424
4425 if (contig_type == CONTIG_LEFT && ret == CONTIG_RIGHT) 4425 if (contig_type == CONTIG_LEFT && ret == CONTIG_RIGHT)
4426 ret = CONTIG_LEFTRIGHT; 4426 ret = CONTIG_LEFTRIGHT;
@@ -5035,7 +5035,7 @@ static int __ocfs2_mark_extent_written(struct inode *inode,
5035 goto out; 5035 goto out;
5036 } 5036 }
5037 5037
5038 ctxt.c_contig_type = ocfs2_figure_merge_contig_type(inode, path, el, 5038 ctxt.c_contig_type = ocfs2_figure_merge_contig_type(et, path, el,
5039 split_index, 5039 split_index,
5040 split_rec); 5040 split_rec);
5041 5041