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/xattr.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/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 9c3d4dc3e2ea..1a4de3dc2ba9 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -211,7 +211,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
211 | 211 | ||
212 | mlog(0, "(clusters_to_add for xattr= %u)\n", clusters_to_add); | 212 | mlog(0, "(clusters_to_add for xattr= %u)\n", clusters_to_add); |
213 | 213 | ||
214 | ocfs2_get_xattr_value_extent_tree(&et, inode, xattr_bh, xv); | 214 | ocfs2_init_xattr_value_extent_tree(&et, inode, xattr_bh, xv); |
215 | 215 | ||
216 | restart_all: | 216 | restart_all: |
217 | 217 | ||
@@ -307,7 +307,6 @@ leave: | |||
307 | goto restart_all; | 307 | goto restart_all; |
308 | } | 308 | } |
309 | 309 | ||
310 | ocfs2_put_extent_tree(&et); | ||
311 | return status; | 310 | return status; |
312 | } | 311 | } |
313 | 312 | ||
@@ -325,11 +324,10 @@ static int __ocfs2_remove_xattr_range(struct inode *inode, | |||
325 | struct ocfs2_alloc_context *meta_ac = NULL; | 324 | struct ocfs2_alloc_context *meta_ac = NULL; |
326 | struct ocfs2_extent_tree et; | 325 | struct ocfs2_extent_tree et; |
327 | 326 | ||
328 | ocfs2_get_xattr_value_extent_tree(&et, inode, root_bh, xv); | 327 | ocfs2_init_xattr_value_extent_tree(&et, inode, root_bh, xv); |
329 | 328 | ||
330 | ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); | 329 | ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); |
331 | if (ret) { | 330 | if (ret) { |
332 | ocfs2_put_extent_tree(&et); | ||
333 | mlog_errno(ret); | 331 | mlog_errno(ret); |
334 | return ret; | 332 | return ret; |
335 | } | 333 | } |
@@ -385,7 +383,6 @@ out: | |||
385 | if (meta_ac) | 383 | if (meta_ac) |
386 | ocfs2_free_alloc_context(meta_ac); | 384 | ocfs2_free_alloc_context(meta_ac); |
387 | 385 | ||
388 | ocfs2_put_extent_tree(&et); | ||
389 | return ret; | 386 | return ret; |
390 | } | 387 | } |
391 | 388 | ||
@@ -3632,7 +3629,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
3632 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 3629 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
3633 | prev_cpos, prev_blkno); | 3630 | prev_cpos, prev_blkno); |
3634 | 3631 | ||
3635 | ocfs2_get_xattr_tree_extent_tree(&et, inode, root_bh); | 3632 | ocfs2_init_xattr_tree_extent_tree(&et, inode, root_bh); |
3636 | 3633 | ||
3637 | ret = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, | 3634 | ret = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, |
3638 | &data_ac, &meta_ac); | 3635 | &data_ac, &meta_ac); |
@@ -3727,7 +3724,6 @@ leave: | |||
3727 | if (meta_ac) | 3724 | if (meta_ac) |
3728 | ocfs2_free_alloc_context(meta_ac); | 3725 | ocfs2_free_alloc_context(meta_ac); |
3729 | 3726 | ||
3730 | ocfs2_put_extent_tree(&et); | ||
3731 | return ret; | 3727 | return ret; |
3732 | } | 3728 | } |
3733 | 3729 | ||
@@ -4336,7 +4332,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, | |||
4336 | struct ocfs2_cached_dealloc_ctxt dealloc; | 4332 | struct ocfs2_cached_dealloc_ctxt dealloc; |
4337 | struct ocfs2_extent_tree et; | 4333 | struct ocfs2_extent_tree et; |
4338 | 4334 | ||
4339 | ocfs2_get_xattr_tree_extent_tree(&et, inode, root_bh); | 4335 | ocfs2_init_xattr_tree_extent_tree(&et, inode, root_bh); |
4340 | 4336 | ||
4341 | ocfs2_init_dealloc_ctxt(&dealloc); | 4337 | ocfs2_init_dealloc_ctxt(&dealloc); |
4342 | 4338 | ||
@@ -4347,7 +4343,6 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, | |||
4347 | 4343 | ||
4348 | ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); | 4344 | ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); |
4349 | if (ret) { | 4345 | if (ret) { |
4350 | ocfs2_put_extent_tree(&et); | ||
4351 | mlog_errno(ret); | 4346 | mlog_errno(ret); |
4352 | return ret; | 4347 | return ret; |
4353 | } | 4348 | } |
@@ -4407,7 +4402,6 @@ out: | |||
4407 | 4402 | ||
4408 | ocfs2_run_deallocs(osb, &dealloc); | 4403 | ocfs2_run_deallocs(osb, &dealloc); |
4409 | 4404 | ||
4410 | ocfs2_put_extent_tree(&et); | ||
4411 | return ret; | 4405 | return ret; |
4412 | } | 4406 | } |
4413 | 4407 | ||