diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-10-09 20:20:31 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-14 14:51:57 -0400 |
commit | 0fcaa56a2a020dd6f90c202b7084e6f4cbedb6c2 (patch) | |
tree | 057204016523ce0274d4a23ec02944075f084e8c /fs/ocfs2/suballoc.c | |
parent | 31d33073ca38603dea705dae45e094a64ca062d6 (diff) |
ocfs2: Simplify ocfs2_read_block()
More than 30 callers of ocfs2_read_block() pass exactly OCFS2_BH_CACHED.
Only six pass a different flag set. Rather than have every caller care,
let's make ocfs2_read_block() take no flags and always do a cached read.
The remaining six places can call ocfs2_read_blocks() directly.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r-- | fs/ocfs2/suballoc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index f0056b7d4353..c5ff18b46b57 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -1172,8 +1172,7 @@ static int ocfs2_search_one_group(struct ocfs2_alloc_context *ac, | |||
1172 | struct ocfs2_group_desc *gd; | 1172 | struct ocfs2_group_desc *gd; |
1173 | struct inode *alloc_inode = ac->ac_inode; | 1173 | struct inode *alloc_inode = ac->ac_inode; |
1174 | 1174 | ||
1175 | ret = ocfs2_read_block(alloc_inode, gd_blkno, | 1175 | ret = ocfs2_read_block(alloc_inode, gd_blkno, &group_bh); |
1176 | &group_bh, OCFS2_BH_CACHED); | ||
1177 | if (ret < 0) { | 1176 | if (ret < 0) { |
1178 | mlog_errno(ret); | 1177 | mlog_errno(ret); |
1179 | return ret; | 1178 | return ret; |
@@ -1244,7 +1243,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
1244 | 1243 | ||
1245 | status = ocfs2_read_block(alloc_inode, | 1244 | status = ocfs2_read_block(alloc_inode, |
1246 | le64_to_cpu(cl->cl_recs[chain].c_blkno), | 1245 | le64_to_cpu(cl->cl_recs[chain].c_blkno), |
1247 | &group_bh, OCFS2_BH_CACHED); | 1246 | &group_bh); |
1248 | if (status < 0) { | 1247 | if (status < 0) { |
1249 | mlog_errno(status); | 1248 | mlog_errno(status); |
1250 | goto bail; | 1249 | goto bail; |
@@ -1273,8 +1272,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
1273 | prev_group_bh = group_bh; | 1272 | prev_group_bh = group_bh; |
1274 | group_bh = NULL; | 1273 | group_bh = NULL; |
1275 | status = ocfs2_read_block(alloc_inode, | 1274 | status = ocfs2_read_block(alloc_inode, |
1276 | next_group, &group_bh, | 1275 | next_group, &group_bh); |
1277 | OCFS2_BH_CACHED); | ||
1278 | if (status < 0) { | 1276 | if (status < 0) { |
1279 | mlog_errno(status); | 1277 | mlog_errno(status); |
1280 | goto bail; | 1278 | goto bail; |
@@ -1795,8 +1793,7 @@ int ocfs2_free_suballoc_bits(handle_t *handle, | |||
1795 | (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, | 1793 | (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, |
1796 | (unsigned long long)bg_blkno, start_bit); | 1794 | (unsigned long long)bg_blkno, start_bit); |
1797 | 1795 | ||
1798 | status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh, | 1796 | status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh); |
1799 | OCFS2_BH_CACHED); | ||
1800 | if (status < 0) { | 1797 | if (status < 0) { |
1801 | mlog_errno(status); | 1798 | mlog_errno(status); |
1802 | goto bail; | 1799 | goto bail; |