aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/suballoc.c
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2010-08-13 18:15:16 -0400
committerTao Ma <tao.ma@oracle.com>2010-09-08 02:25:58 -0400
commitd51349829c378c06ba4aa7d4b16ca23739858608 (patch)
tree972c0087222f803e7789a44e40e27585790333bf /fs/ocfs2/suballoc.c
parent021960cab320ae3cc4e9aba9cca42f9f5ce785f3 (diff)
ocfs2: use ocfs2_alloc_dinode_update_counts() instead of open coding
ocfs2_search_chain() makes the same updates as ocfs2_alloc_dinode_update_counts to the alloc inode. Instead of open coding the bitmap update, use our helper function. Signed-off-by: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r--fs/ocfs2/suballoc.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index b93d7e72175a..e7edda8c6a11 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -1719,7 +1719,6 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1719{ 1719{
1720 int status; 1720 int status;
1721 u16 chain; 1721 u16 chain;
1722 u32 tmp_used;
1723 u64 next_group; 1722 u64 next_group;
1724 struct inode *alloc_inode = ac->ac_inode; 1723 struct inode *alloc_inode = ac->ac_inode;
1725 struct buffer_head *group_bh = NULL; 1724 struct buffer_head *group_bh = NULL;
@@ -1807,22 +1806,14 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1807 } 1806 }
1808 } 1807 }
1809 1808
1810 /* Ok, claim our bits now: set the info on dinode, chainlist 1809 status = ocfs2_alloc_dinode_update_counts(alloc_inode, handle,
1811 * and then the group */ 1810 ac->ac_bh, res->sr_bits,
1812 status = ocfs2_journal_access_di(handle, 1811 chain);
1813 INODE_CACHE(alloc_inode), 1812 if (status) {
1814 ac->ac_bh,
1815 OCFS2_JOURNAL_ACCESS_WRITE);
1816 if (status < 0) {
1817 mlog_errno(status); 1813 mlog_errno(status);
1818 goto bail; 1814 goto bail;
1819 } 1815 }
1820 1816
1821 tmp_used = le32_to_cpu(fe->id1.bitmap1.i_used);
1822 fe->id1.bitmap1.i_used = cpu_to_le32(res->sr_bits + tmp_used);
1823 le32_add_cpu(&cl->cl_recs[chain].c_free, -res->sr_bits);
1824 ocfs2_journal_dirty(handle, ac->ac_bh);
1825
1826 status = ocfs2_block_group_set_bits(handle, 1817 status = ocfs2_block_group_set_bits(handle,
1827 alloc_inode, 1818 alloc_inode,
1828 bg, 1819 bg,