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/file.c | |
parent | 1625f8ac151743e452ec062c2989669c508ffa48 (diff) | |
download | op-kernel-dev-8d6220d6a74a33552cf877bcea25503d7f6a59e6.zip op-kernel-dev-8d6220d6a74a33552cf877bcea25503d7f6a59e6.tar.gz |
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 ca3d38a..441c6a9 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -512,12 +512,11 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb, int ret; struct ocfs2_extent_tree et; - ocfs2_get_dinode_extent_tree(&et, inode, fe_bh); + ocfs2_init_dinode_extent_tree(&et, inode, fe_bh); ret = ocfs2_add_clusters_in_btree(osb, inode, logical_offset, clusters_to_add, mark_unwritten, &et, handle, data_ac, meta_ac, reason_ret); - ocfs2_put_extent_tree(&et); return ret; } @@ -568,10 +567,9 @@ restart_all: (unsigned long long)OCFS2_I(inode)->ip_blkno, (long long)i_size_read(inode), le32_to_cpu(fe->i_clusters), clusters_to_add); - ocfs2_get_dinode_extent_tree(&et, inode, bh); + ocfs2_init_dinode_extent_tree(&et, inode, bh); status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, &data_ac, &meta_ac); - ocfs2_put_extent_tree(&et); if (status) { mlog_errno(status); goto leave; @@ -1243,11 +1241,10 @@ static int __ocfs2_remove_inode_range(struct inode *inode, struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; struct ocfs2_extent_tree et; - ocfs2_get_dinode_extent_tree(&et, inode, di_bh); + ocfs2_init_dinode_extent_tree(&et, inode, di_bh); ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); if (ret) { - ocfs2_put_extent_tree(&et); mlog_errno(ret); return ret; } @@ -1304,7 +1301,6 @@ out: if (meta_ac) ocfs2_free_alloc_context(meta_ac); - ocfs2_put_extent_tree(&et); return ret; } |