summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dir.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-08-22 21:46:09 +0200
committerMark Fasheh <mfasheh@suse.com>2008-10-14 01:57:05 +0200
commit8d6220d6a74a33552cf877bcea25503d7f6a59e6 (patch)
tree2c3f662c55ab4a0a22989c06edf0d027387bfbed /fs/ocfs2/dir.c
parentocfs2: Comment struct ocfs2_extent_tree_operations. (diff)
downloadlinux-8d6220d6a74a33552cf877bcea25503d7f6a59e6.tar.xz
linux-8d6220d6a74a33552cf877bcea25503d7f6a59e6.zip
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/dir.c')
-rw-r--r--fs/ocfs2/dir.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 2cdc55390348..167e6c96277d 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -1194,7 +1194,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
handle_t *handle;
struct ocfs2_extent_tree et;
- ocfs2_get_dinode_extent_tree(&et, dir, di_bh);
+ ocfs2_init_dinode_extent_tree(&et, dir, di_bh);
alloc = ocfs2_clusters_for_bytes(sb, bytes);
@@ -1363,7 +1363,6 @@ out:
brelse(dirdata_bh);
- ocfs2_put_extent_tree(&et);
return ret;
}
@@ -1485,9 +1484,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
spin_lock(&OCFS2_I(dir)->ip_lock);
if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) {
spin_unlock(&OCFS2_I(dir)->ip_lock);
- ocfs2_get_dinode_extent_tree(&et, dir, parent_fe_bh);
+ ocfs2_init_dinode_extent_tree(&et, dir, parent_fe_bh);
num_free_extents = ocfs2_num_free_extents(osb, dir, &et);
- ocfs2_put_extent_tree(&et);
if (num_free_extents < 0) {
status = num_free_extents;
mlog_errno(status);