diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-08-22 12:46:09 -0700 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 16:57:05 -0700 |
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 9c3d4dc3e2e..1a4de3dc2ba 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -211,7 +211,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, mlog(0, "(clusters_to_add for xattr= %u)\n", clusters_to_add); - ocfs2_get_xattr_value_extent_tree(&et, inode, xattr_bh, xv); + ocfs2_init_xattr_value_extent_tree(&et, inode, xattr_bh, xv); restart_all: @@ -307,7 +307,6 @@ leave: goto restart_all; } - ocfs2_put_extent_tree(&et); return status; } @@ -325,11 +324,10 @@ static int __ocfs2_remove_xattr_range(struct inode *inode, struct ocfs2_alloc_context *meta_ac = NULL; struct ocfs2_extent_tree et; - ocfs2_get_xattr_value_extent_tree(&et, inode, root_bh, xv); + ocfs2_init_xattr_value_extent_tree(&et, inode, root_bh, xv); ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); if (ret) { - ocfs2_put_extent_tree(&et); mlog_errno(ret); return ret; } @@ -385,7 +383,6 @@ out: if (meta_ac) ocfs2_free_alloc_context(meta_ac); - ocfs2_put_extent_tree(&et); return ret; } @@ -3632,7 +3629,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, (unsigned long long)OCFS2_I(inode)->ip_blkno, prev_cpos, prev_blkno); - ocfs2_get_xattr_tree_extent_tree(&et, inode, root_bh); + ocfs2_init_xattr_tree_extent_tree(&et, inode, root_bh); ret = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, &data_ac, &meta_ac); @@ -3727,7 +3724,6 @@ leave: if (meta_ac) ocfs2_free_alloc_context(meta_ac); - ocfs2_put_extent_tree(&et); return ret; } @@ -4336,7 +4332,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, struct ocfs2_cached_dealloc_ctxt dealloc; struct ocfs2_extent_tree et; - ocfs2_get_xattr_tree_extent_tree(&et, inode, root_bh); + ocfs2_init_xattr_tree_extent_tree(&et, inode, root_bh); ocfs2_init_dealloc_ctxt(&dealloc); @@ -4347,7 +4343,6 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); if (ret) { - ocfs2_put_extent_tree(&et); mlog_errno(ret); return ret; } @@ -4407,7 +4402,6 @@ out: ocfs2_run_deallocs(osb, &dealloc); - ocfs2_put_extent_tree(&et); return ret; } |