aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/aops.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-08-22 15:46:09 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-13 19:57:05 -0400
commit8d6220d6a74a33552cf877bcea25503d7f6a59e6 (patch)
tree2c3f662c55ab4a0a22989c06edf0d027387bfbed /fs/ocfs2/aops.c
parent1625f8ac151743e452ec062c2989669c508ffa48 (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/aops.c')
-rw-r--r--fs/ocfs2/aops.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index ed937fa9e4e3..259775eedb85 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1277,11 +1277,10 @@ static int ocfs2_write_cluster(struct address_space *mapping,
1277 goto out; 1277 goto out;
1278 } 1278 }
1279 } else if (unwritten) { 1279 } else if (unwritten) {
1280 ocfs2_get_dinode_extent_tree(&et, inode, wc->w_di_bh); 1280 ocfs2_init_dinode_extent_tree(&et, inode, wc->w_di_bh);
1281 ret = ocfs2_mark_extent_written(inode, &et, 1281 ret = ocfs2_mark_extent_written(inode, &et,
1282 wc->w_handle, cpos, 1, phys, 1282 wc->w_handle, cpos, 1, phys,
1283 meta_ac, &wc->w_dealloc); 1283 meta_ac, &wc->w_dealloc);
1284 ocfs2_put_extent_tree(&et);
1285 if (ret < 0) { 1284 if (ret < 0) {
1286 mlog_errno(ret); 1285 mlog_errno(ret);
1287 goto out; 1286 goto out;
@@ -1722,11 +1721,10 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
1722 (long long)i_size_read(inode), le32_to_cpu(di->i_clusters), 1721 (long long)i_size_read(inode), le32_to_cpu(di->i_clusters),
1723 clusters_to_alloc, extents_to_split); 1722 clusters_to_alloc, extents_to_split);
1724 1723
1725 ocfs2_get_dinode_extent_tree(&et, inode, wc->w_di_bh); 1724 ocfs2_init_dinode_extent_tree(&et, inode, wc->w_di_bh);
1726 ret = ocfs2_lock_allocators(inode, &et, 1725 ret = ocfs2_lock_allocators(inode, &et,
1727 clusters_to_alloc, extents_to_split, 1726 clusters_to_alloc, extents_to_split,
1728 &data_ac, &meta_ac); 1727 &data_ac, &meta_ac);
1729 ocfs2_put_extent_tree(&et);
1730 if (ret) { 1728 if (ret) {
1731 mlog_errno(ret); 1729 mlog_errno(ret);
1732 goto out; 1730 goto out;