diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-08-22 15:46:09 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 19:57:05 -0400 |
commit | 8d6220d6a74a33552cf877bcea25503d7f6a59e6 (patch) | |
tree | 2c3f662c55ab4a0a22989c06edf0d027387bfbed /fs/ocfs2/file.c | |
parent | 1625f8ac151743e452ec062c2989669c508ffa48 (diff) |
ocfs2: Change ocfs2_get_*_extent_tree() to ocfs2_init_*_extent_tree()
The original get/put_extent_tree() functions held a reference on
et_root_bh. However, every single caller already has a safe reference,
making the get/put cycle irrelevant.
We change ocfs2_get_*_extent_tree() to ocfs2_init_*_extent_tree(). It
no longer gets a reference on et_root_bh. ocfs2_put_extent_tree() is
removed. Callers now have a simpler init+use pattern.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ca3d38addbb9..441c6a94059d 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -512,12 +512,11 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb, | |||
512 | int ret; | 512 | int ret; |
513 | struct ocfs2_extent_tree et; | 513 | struct ocfs2_extent_tree et; |
514 | 514 | ||
515 | ocfs2_get_dinode_extent_tree(&et, inode, fe_bh); | 515 | ocfs2_init_dinode_extent_tree(&et, inode, fe_bh); |
516 | ret = ocfs2_add_clusters_in_btree(osb, inode, logical_offset, | 516 | ret = ocfs2_add_clusters_in_btree(osb, inode, logical_offset, |
517 | clusters_to_add, mark_unwritten, | 517 | clusters_to_add, mark_unwritten, |
518 | &et, handle, | 518 | &et, handle, |
519 | data_ac, meta_ac, reason_ret); | 519 | data_ac, meta_ac, reason_ret); |
520 | ocfs2_put_extent_tree(&et); | ||
521 | 520 | ||
522 | return ret; | 521 | return ret; |
523 | } | 522 | } |
@@ -568,10 +567,9 @@ restart_all: | |||
568 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 567 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
569 | (long long)i_size_read(inode), le32_to_cpu(fe->i_clusters), | 568 | (long long)i_size_read(inode), le32_to_cpu(fe->i_clusters), |
570 | clusters_to_add); | 569 | clusters_to_add); |
571 | ocfs2_get_dinode_extent_tree(&et, inode, bh); | 570 | ocfs2_init_dinode_extent_tree(&et, inode, bh); |
572 | status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, | 571 | status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, |
573 | &data_ac, &meta_ac); | 572 | &data_ac, &meta_ac); |
574 | ocfs2_put_extent_tree(&et); | ||
575 | if (status) { | 573 | if (status) { |
576 | mlog_errno(status); | 574 | mlog_errno(status); |
577 | goto leave; | 575 | goto leave; |
@@ -1243,11 +1241,10 @@ static int __ocfs2_remove_inode_range(struct inode *inode, | |||
1243 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; | 1241 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; |
1244 | struct ocfs2_extent_tree et; | 1242 | struct ocfs2_extent_tree et; |
1245 | 1243 | ||
1246 | ocfs2_get_dinode_extent_tree(&et, inode, di_bh); | 1244 | ocfs2_init_dinode_extent_tree(&et, inode, di_bh); |
1247 | 1245 | ||
1248 | ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); | 1246 | ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); |
1249 | if (ret) { | 1247 | if (ret) { |
1250 | ocfs2_put_extent_tree(&et); | ||
1251 | mlog_errno(ret); | 1248 | mlog_errno(ret); |
1252 | return ret; | 1249 | return ret; |
1253 | } | 1250 | } |
@@ -1304,7 +1301,6 @@ out: | |||
1304 | if (meta_ac) | 1301 | if (meta_ac) |
1305 | ocfs2_free_alloc_context(meta_ac); | 1302 | ocfs2_free_alloc_context(meta_ac); |
1306 | 1303 | ||
1307 | ocfs2_put_extent_tree(&et); | ||
1308 | return ret; | 1304 | return ret; |
1309 | } | 1305 | } |
1310 | 1306 | ||