aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-10-09 20:20:31 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-14 14:51:57 -0400
commit0fcaa56a2a020dd6f90c202b7084e6f4cbedb6c2 (patch)
tree057204016523ce0274d4a23ec02944075f084e8c /fs/ocfs2/file.c
parent31d33073ca38603dea705dae45e094a64ca062d6 (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/file.c')
-rw-r--r--fs/ocfs2/file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 7a809be54e84..8d3225a78073 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -545,8 +545,7 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
545 */ 545 */
546 BUG_ON(mark_unwritten && !ocfs2_sparse_alloc(osb)); 546 BUG_ON(mark_unwritten && !ocfs2_sparse_alloc(osb));
547 547
548 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh, 548 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
549 OCFS2_BH_CACHED);
550 if (status < 0) { 549 if (status < 0) {
551 mlog_errno(status); 550 mlog_errno(status);
552 goto leave; 551 goto leave;
@@ -1132,7 +1131,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
1132 struct buffer_head *bh = NULL; 1131 struct buffer_head *bh = NULL;
1133 struct ocfs2_inode_info *oi = OCFS2_I(inode); 1132 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1134 1133
1135 ret = ocfs2_read_block(inode, oi->ip_blkno, &bh, OCFS2_BH_CACHED); 1134 ret = ocfs2_read_block(inode, oi->ip_blkno, &bh);
1136 if (ret < 0) { 1135 if (ret < 0) {
1137 mlog_errno(ret); 1136 mlog_errno(ret);
1138 goto out; 1137 goto out;
@@ -1159,7 +1158,7 @@ static int ocfs2_allocate_unwritten_extents(struct inode *inode,
1159 1158
1160 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { 1159 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
1161 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, 1160 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
1162 &di_bh, OCFS2_BH_CACHED); 1161 &di_bh);
1163 if (ret) { 1162 if (ret) {
1164 mlog_errno(ret); 1163 mlog_errno(ret);
1165 goto out; 1164 goto out;