]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ocfs2: Simplify ocfs2_read_block()
authorJoel Becker <joel.becker@oracle.com>
Fri, 10 Oct 2008 00:20:31 +0000 (17:20 -0700)
committerMark Fasheh <mfasheh@suse.com>
Tue, 14 Oct 2008 18:51:57 +0000 (11:51 -0700)
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>
16 files changed:
fs/ocfs2/alloc.c
fs/ocfs2/aops.c
fs/ocfs2/buffer_head_io.h
fs/ocfs2/dir.c
fs/ocfs2/dlmglue.c
fs/ocfs2/extent_map.c
fs/ocfs2/file.c
fs/ocfs2/inode.c
fs/ocfs2/journal.c
fs/ocfs2/localalloc.c
fs/ocfs2/namei.c
fs/ocfs2/resize.c
fs/ocfs2/slot_map.c
fs/ocfs2/suballoc.c
fs/ocfs2/symlink.c
fs/ocfs2/xattr.c

index a164e09491f89984534e1c38fa5873808042efad..0cc2deb9394c02e1a961c0a1366ae5737b8f32bc 100644 (file)
@@ -706,7 +706,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
 
        if (last_eb_blk) {
                retval = ocfs2_read_block(inode, last_eb_blk,
-                                         &eb_bh, OCFS2_BH_CACHED);
+                                         &eb_bh);
                if (retval < 0) {
                        mlog_errno(retval);
                        goto bail;
@@ -1176,7 +1176,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
                brelse(bh);
                bh = NULL;
 
-               status = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
+               status = ocfs2_read_block(inode, blkno, &bh);
                if (status < 0) {
                        mlog_errno(status);
                        goto bail;
@@ -1540,7 +1540,7 @@ static int __ocfs2_find_path(struct inode *inode,
 
                brelse(bh);
                bh = NULL;
-               ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, blkno, &bh);
                if (ret) {
                        mlog_errno(ret);
                        goto out;
@@ -4294,9 +4294,7 @@ static int ocfs2_figure_insert_type(struct inode *inode,
                 * ocfs2_figure_insert_type() and ocfs2_add_branch()
                 * may want it later.
                 */
-               ret = ocfs2_read_block(inode,
-                                      ocfs2_et_get_last_eb_blk(et), &bh,
-                                      OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, ocfs2_et_get_last_eb_blk(et), &bh);
                if (ret) {
                        mlog_exit(ret);
                        goto out;
@@ -4762,9 +4760,8 @@ static int __ocfs2_mark_extent_written(struct inode *inode,
        if (path->p_tree_depth) {
                struct ocfs2_extent_block *eb;
 
-               ret = ocfs2_read_block(inode,
-                                      ocfs2_et_get_last_eb_blk(et),
-                                      &last_eb_bh, OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, ocfs2_et_get_last_eb_blk(et),
+                                      &last_eb_bh);
                if (ret) {
                        mlog_exit(ret);
                        goto out;
@@ -4921,9 +4918,8 @@ static int ocfs2_split_tree(struct inode *inode, struct ocfs2_extent_tree *et,
 
        depth = path->p_tree_depth;
        if (depth > 0) {
-               ret = ocfs2_read_block(inode,
-                                      ocfs2_et_get_last_eb_blk(et),
-                                      &last_eb_bh, OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, ocfs2_et_get_last_eb_blk(et),
+                                      &last_eb_bh);
                if (ret < 0) {
                        mlog_errno(ret);
                        goto out;
@@ -5590,8 +5586,7 @@ static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
                goto bail;
        }
 
-       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
-                                 OCFS2_BH_CACHED);
+       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
        if (status < 0) {
                iput(inode);
                mlog_errno(status);
@@ -6990,7 +6985,7 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
 
        if (fe->id2.i_list.l_tree_depth) {
                status = ocfs2_read_block(inode, le64_to_cpu(fe->i_last_eb_blk),
-                                         &last_eb_bh, OCFS2_BH_CACHED);
+                                         &last_eb_bh);
                if (status < 0) {
                        mlog_errno(status);
                        goto bail;
index f232a0e3c30f0aec8f1e54ebffa35cab41949ccc..c22543b3342062f0308ec06a6f74f2334291727f 100644 (file)
@@ -68,8 +68,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
                goto bail;
        }
 
-       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
-                                 &bh, OCFS2_BH_CACHED);
+       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
@@ -263,8 +262,7 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
        BUG_ON(!PageLocked(page));
        BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
 
-       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh,
-                              OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
index fd0d774ac356bc5131d6ea88a176d5e2a6ca0634..a2ef9e5f8bfe4ae8dc1da77236efc7ab28add4c6 100644 (file)
@@ -33,8 +33,7 @@ void ocfs2_end_buffer_io_sync(struct buffer_head *bh,
 
 static inline int ocfs2_read_block(struct inode               *inode,
                                   u64                  off,
-                                  struct buffer_head **bh,
-                                  int                  flags);
+                                  struct buffer_head **bh);
 
 int ocfs2_write_block(struct ocfs2_super          *osb,
                      struct buffer_head  *bh,
@@ -54,7 +53,7 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
 #define OCFS2_BH_READAHEAD         8
 
 static inline int ocfs2_read_block(struct inode *inode, u64 off,
-                                  struct buffer_head **bh, int flags)
+                                  struct buffer_head **bh)
 {
        int status = 0;
 
@@ -64,7 +63,7 @@ static inline int ocfs2_read_block(struct inode *inode, u64 off,
                goto bail;
        }
 
-       status = ocfs2_read_blocks(inode, off, 1, bh, flags);
+       status = ocfs2_read_blocks(inode, off, 1, bh, OCFS2_BH_CACHED);
 
 bail:
        return status;
index 828437ca91ba496fe0cfeed58796a4726534100e..459e6b8467dcb0493e2c59982afd158ad8e0871a 100644 (file)
@@ -188,8 +188,7 @@ static struct buffer_head *ocfs2_find_entry_id(const char *name,
        struct ocfs2_dinode *di;
        struct ocfs2_inline_data *data;
 
-       ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh,
-                              OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -417,8 +416,7 @@ static inline int ocfs2_delete_entry_id(handle_t *handle,
        struct ocfs2_dinode *di;
        struct ocfs2_inline_data *data;
 
-       ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno,
-                              &di_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -596,8 +594,7 @@ static int ocfs2_dir_foreach_blk_id(struct inode *inode,
        struct ocfs2_inline_data *data;
        struct ocfs2_dir_entry *de;
 
-       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
-                              &di_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
        if (ret) {
                mlog(ML_ERROR, "Unable to read inode block for dir %llu\n",
                     (unsigned long long)OCFS2_I(inode)->ip_blkno);
index 3b2cd0f8721089941dfd2cfb1b3ff3951c02c5d6..ec684426034b6dc39ab2b772acc918d07cce6ccd 100644 (file)
@@ -2024,8 +2024,7 @@ static int ocfs2_inode_lock_update(struct inode *inode,
        } else {
                /* Boo, we have to go to disk. */
                /* read bh, cast, ocfs2_refresh_inode */
-               status = ocfs2_read_block(inode, oi->ip_blkno,
-                                         bh, OCFS2_BH_CACHED);
+               status = ocfs2_read_block(inode, oi->ip_blkno, bh);
                if (status < 0) {
                        mlog_errno(status);
                        goto bail_refresh;
@@ -2086,10 +2085,7 @@ static int ocfs2_assign_bh(struct inode *inode,
                return 0;
        }
 
-       status = ocfs2_read_block(inode,
-                                 OCFS2_I(inode)->ip_blkno,
-                                 ret_bh,
-                                 OCFS2_BH_CACHED);
+       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, ret_bh);
        if (status < 0)
                mlog_errno(status);
 
index 5b482214bb755abe6ec0fb8d1b1f82bea5ee7b96..2baedac582341dbb60986840b29daded17521842 100644 (file)
@@ -293,8 +293,7 @@ static int ocfs2_last_eb_is_empty(struct inode *inode,
        struct ocfs2_extent_block *eb;
        struct ocfs2_extent_list *el;
 
-       ret = ocfs2_read_block(inode, last_eb_blk,
-                              &eb_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, last_eb_blk, &eb_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -384,7 +383,7 @@ static int ocfs2_figure_hole_clusters(struct inode *inode,
 
                ret = ocfs2_read_block(inode,
                                       le64_to_cpu(eb->h_next_leaf_blk),
-                                      &next_eb_bh, OCFS2_BH_CACHED);
+                                      &next_eb_bh);
                if (ret) {
                        mlog_errno(ret);
                        goto out;
@@ -631,8 +630,7 @@ int ocfs2_get_clusters(struct inode *inode, u32 v_cluster,
        if (ret == 0)
                goto out;
 
-       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
-                              &di_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
index 7a809be54e84b1dff43e2d8c8a54435fe25ec0f2..8d3225a78073f86c682ed21e9b3098a1fef6b843 100644 (file)
@@ -545,8 +545,7 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
         */
        BUG_ON(mark_unwritten && !ocfs2_sparse_alloc(osb));
 
-       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
-                                 OCFS2_BH_CACHED);
+       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
        if (status < 0) {
                mlog_errno(status);
                goto leave;
@@ -1132,7 +1131,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
        struct buffer_head *bh = NULL;
        struct ocfs2_inode_info *oi = OCFS2_I(inode);
 
-       ret = ocfs2_read_block(inode, oi->ip_blkno, &bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, oi->ip_blkno, &bh);
        if (ret < 0) {
                mlog_errno(ret);
                goto out;
@@ -1159,7 +1158,7 @@ static int ocfs2_allocate_unwritten_extents(struct inode *inode,
 
        if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
                ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
-                                      &di_bh, OCFS2_BH_CACHED);
+                                      &di_bh);
                if (ret) {
                        mlog_errno(ret);
                        goto out;
index 6ec31b92a47f2910bae5f10db1ec8cf0a11c556c..c5ee9e3cf80b22156298db3352b346e0c4874c23 100644 (file)
@@ -461,7 +461,7 @@ static int ocfs2_read_locked_inode(struct inode *inode,
        }
 
        if (can_lock)
-               status = ocfs2_read_block(inode, args->fi_blkno, &bh, 0);
+               status = ocfs2_read_blocks(inode, args->fi_blkno, 1, &bh, 0);
        else
                status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
        if (status < 0) {
@@ -1165,7 +1165,7 @@ struct buffer_head *ocfs2_bread(struct inode *inode,
                goto fail;
        }
 
-       tmperr = ocfs2_read_block(inode, p_blkno, &bh, readflags);
+       tmperr = ocfs2_read_blocks(inode, p_blkno, 1, &bh, readflags);
        if (tmperr < 0)
                goto fail;
 
index 9854fb7315b6c3d29cfd950116662080068ff592..d161fe5e3bde908ea3201db01661ab69b8a1d7a7 100644 (file)
@@ -1134,7 +1134,7 @@ static int ocfs2_read_journal_inode(struct ocfs2_super *osb,
        }
        SET_INODE_JOURNAL(inode);
 
-       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, bh, 0);
+       status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1, bh, 0);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
index b77b67bb27765bbb7a8db1b2036206ce3e1d3258..3ea740d15feb73502d4e609e01f51284659164bd 100644 (file)
@@ -248,8 +248,8 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
                goto bail;
        }
 
-       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
-                                 &alloc_bh, 0);
+       status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1,
+                                  &alloc_bh, 0);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
@@ -459,8 +459,8 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
 
        mutex_lock(&inode->i_mutex);
 
-       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
-                                 &alloc_bh, 0);
+       status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1,
+                                  &alloc_bh, 0);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
index e5fc9345dd3601818bf58a1fc967a0640b73174f..485a6aa0ad39060e9eb27f2897be98026b886d4c 100644 (file)
@@ -1754,7 +1754,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb,
 
        status = ocfs2_read_block(orphan_dir_inode,
                                  OCFS2_I(orphan_dir_inode)->ip_blkno,
-                                 &orphan_dir_bh, OCFS2_BH_CACHED);
+                                 &orphan_dir_bh);
        if (status < 0) {
                mlog_errno(status);
                goto leave;
index 92dcd93505601e4a834d794815d8695dbf958625..ffd48db229a75323d31b250e7b5fd885fc7eff63 100644 (file)
@@ -332,8 +332,7 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters)
        lgd_blkno = ocfs2_which_cluster_group(main_bm_inode,
                                              first_new_cluster - 1);
 
-       ret = ocfs2_read_block(main_bm_inode, lgd_blkno, &group_bh,
-                              OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(main_bm_inode, lgd_blkno, &group_bh);
        if (ret < 0) {
                mlog_errno(ret);
                goto out_unlock;
index 82d986bff7feb1491804b430b83b3b65e95a9650..357d3fe18c3fe0e4caae57651d3f4abece4dbc12 100644 (file)
@@ -403,7 +403,7 @@ static int ocfs2_map_slot_buffers(struct ocfs2_super *osb,
                     (unsigned long long)blkno);
 
                bh = NULL;  /* Acquire a fresh bh */
-               status = ocfs2_read_block(si->si_inode, blkno, &bh, 0);
+               status = ocfs2_read_blocks(si->si_inode, blkno, 1, &bh, 0);
                if (status < 0) {
                        mlog_errno(status);
                        goto bail;
index f0056b7d435316515ebcc15b8c035d322b12c5fd..c5ff18b46b57524884d9c4b7639f8089e7d3c532 100644 (file)
@@ -1172,8 +1172,7 @@ static int ocfs2_search_one_group(struct ocfs2_alloc_context *ac,
        struct ocfs2_group_desc *gd;
        struct inode *alloc_inode = ac->ac_inode;
 
-       ret = ocfs2_read_block(alloc_inode, gd_blkno,
-                              &group_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(alloc_inode, gd_blkno, &group_bh);
        if (ret < 0) {
                mlog_errno(ret);
                return ret;
@@ -1244,7 +1243,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
 
        status = ocfs2_read_block(alloc_inode,
                                  le64_to_cpu(cl->cl_recs[chain].c_blkno),
-                                 &group_bh, OCFS2_BH_CACHED);
+                                 &group_bh);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
@@ -1273,8 +1272,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
                prev_group_bh = group_bh;
                group_bh = NULL;
                status = ocfs2_read_block(alloc_inode,
-                                         next_group, &group_bh,
-                                         OCFS2_BH_CACHED);
+                                         next_group, &group_bh);
                if (status < 0) {
                        mlog_errno(status);
                        goto bail;
@@ -1795,8 +1793,7 @@ int ocfs2_free_suballoc_bits(handle_t *handle,
             (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count,
             (unsigned long long)bg_blkno, start_bit);
 
-       status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh,
-                                 OCFS2_BH_CACHED);
+       status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
index 8788dc26316de4eb729427d5c5bbe322beba0a47..cbd03dfdc7b987aaef8810adfbce4590e6fdacc8 100644 (file)
@@ -84,10 +84,7 @@ static char *ocfs2_fast_symlink_getlink(struct inode *inode,
 
        mlog_entry_void();
 
-       status = ocfs2_read_block(inode,
-                                 OCFS2_I(inode)->ip_blkno,
-                                 bh,
-                                 OCFS2_BH_CACHED);
+       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, bh);
        if (status < 0) {
                mlog_errno(status);
                link = ERR_PTR(status);
index 63037bd7892fb21710f944c7b3d36bd1dad80dc5..c25780a70dfd6757864c68ed685df1537a6a2937 100644 (file)
@@ -537,9 +537,7 @@ static int ocfs2_xattr_block_list(struct inode *inode,
        if (!di->i_xattr_loc)
                return ret;
 
-       ret = ocfs2_read_block(inode,
-                              le64_to_cpu(di->i_xattr_loc),
-                              &blk_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh);
        if (ret < 0) {
                mlog_errno(ret);
                return ret;
@@ -672,8 +670,7 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode,
                blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
                /* Copy ocfs2_xattr_value */
                for (i = 0; i < num_clusters * bpc; i++, blkno++) {
-                       ret = ocfs2_read_block(inode, blkno,
-                                              &bh, OCFS2_BH_CACHED);
+                       ret = ocfs2_read_block(inode, blkno, &bh);
                        if (ret) {
                                mlog_errno(ret);
                                goto out;
@@ -764,9 +761,7 @@ static int ocfs2_xattr_block_get(struct inode *inode,
 
        memset(&xs->bucket, 0, sizeof(xs->bucket));
 
-       ret = ocfs2_read_block(inode,
-                              le64_to_cpu(di->i_xattr_loc),
-                              &blk_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh);
        if (ret < 0) {
                mlog_errno(ret);
                return ret;
@@ -922,8 +917,7 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode,
                blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
 
                for (i = 0; i < num_clusters * bpc; i++, blkno++) {
-                       ret = ocfs2_read_block(inode, blkno,
-                                              &bh, OCFS2_BH_CACHED);
+                       ret = ocfs2_read_block(inode, blkno, &bh);
                        if (ret) {
                                mlog_errno(ret);
                                goto out_commit;
@@ -1514,8 +1508,7 @@ static int ocfs2_xattr_free_block(struct inode *inode,
        u64 blk, bg_blkno;
        u16 bit;
 
-       ret = ocfs2_read_block(inode, block, &blk_bh,
-                              OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, block, &blk_bh);
        if (ret < 0) {
                mlog_errno(ret);
                goto out;
@@ -1773,9 +1766,7 @@ static int ocfs2_xattr_block_find(struct inode *inode,
        if (!di->i_xattr_loc)
                return ret;
 
-       ret = ocfs2_read_block(inode,
-                              le64_to_cpu(di->i_xattr_loc),
-                              &blk_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh);
        if (ret < 0) {
                mlog_errno(ret);
                return ret;
@@ -2216,9 +2207,8 @@ static int ocfs2_find_xe_in_bucket(struct inode *inode,
                        break;
                }
 
-               ret = ocfs2_read_block(inode,
-                                      header_bh->b_blocknr + block_off,
-                                      &name_bh, OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, header_bh->b_blocknr + block_off,
+                                      &name_bh);
                if (ret) {
                        mlog_errno(ret);
                        break;
@@ -2269,7 +2259,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
        u32 last_hash;
        u64 blkno;
 
-       ret = ocfs2_read_block(inode, p_blkno, &bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, p_blkno, &bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -2285,7 +2275,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
 
                blkno = p_blkno + bucket * blk_per_bucket;
 
-               ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, blkno, &bh);
                if (ret) {
                        mlog_errno(ret);
                        goto out;
@@ -2898,7 +2888,6 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode,
        u64 blkno = bucket->bhs[0]->b_blocknr;
        u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
        u16 xh_free_start;
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
        size_t blocksize = inode->i_sb->s_blocksize;
        handle_t *handle;
        struct buffer_head **bhs;
@@ -3110,8 +3099,7 @@ static int ocfs2_mv_xattr_bucket_cross_cluster(struct inode *inode,
                        goto out;
                }
 
-               ret = ocfs2_read_block(inode, prev_blkno,
-                                      &old_bh, OCFS2_BH_CACHED);
+               ret = ocfs2_read_block(inode, prev_blkno, &old_bh);
                if (ret < 0) {
                        mlog_errno(ret);
                        brelse(new_bh);
@@ -3481,7 +3469,7 @@ static int ocfs2_cp_xattr_cluster(struct inode *inode,
        ocfs2_journal_dirty(handle, first_bh);
 
        /* update the new bucket header. */
-       ret = ocfs2_read_block(inode, to_blk_start, &bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, to_blk_start, &bh);
        if (ret < 0) {
                mlog_errno(ret);
                goto out;
@@ -3868,8 +3856,7 @@ static int ocfs2_add_new_xattr_bucket(struct inode *inode,
                goto out;
        }
 
-       ret = ocfs2_read_block(inode, p_blkno,
-                              &first_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, p_blkno, &first_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -4220,8 +4207,7 @@ static int ocfs2_xattr_bucket_value_truncate(struct inode *inode,
        BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize);
        value_blk += header_bh->b_blocknr;
 
-       ret = ocfs2_read_block(inode, value_blk,
-                              &value_bh, OCFS2_BH_CACHED);
+       ret = ocfs2_read_block(inode, value_blk, &value_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;