]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.suse/ocfs2-Simplify-ocfs2_read_block.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.suse / ocfs2-Simplify-ocfs2_read_block.patch
CommitLineData
2cb7cef9
BS
1From: Joel Becker <joel.becker@oracle.com>
2Subject: ocfs2: Simplify ocfs2_read_block()
3Patch-mainline: 2.6.28
4
5More than 30 callers of ocfs2_read_block() pass exactly OCFS2_BH_CACHED.
6Only six pass a different flag set. Rather than have every caller care,
7let's make ocfs2_read_block() take no flags and always do a cached read.
8The remaining six places can call ocfs2_read_blocks() directly.
9
10Signed-off-by: Joel Becker <joel.becker@oracle.com>
11Signed-off-by: Mark Fasheh <mfasheh@suse.com>
12---
13 fs/ocfs2/alloc.c | 25 ++++++++++---------------
14 fs/ocfs2/aops.c | 6 ++----
15 fs/ocfs2/buffer_head_io.h | 7 +++----
16 fs/ocfs2/dir.c | 9 +++------
17 fs/ocfs2/dlmglue.c | 8 ++------
18 fs/ocfs2/extent_map.c | 8 +++-----
19 fs/ocfs2/file.c | 7 +++----
20 fs/ocfs2/inode.c | 4 ++--
21 fs/ocfs2/journal.c | 2 +-
22 fs/ocfs2/localalloc.c | 8 ++++----
23 fs/ocfs2/namei.c | 2 +-
24 fs/ocfs2/resize.c | 3 +--
25 fs/ocfs2/slot_map.c | 2 +-
26 fs/ocfs2/suballoc.c | 11 ++++-------
27 fs/ocfs2/symlink.c | 5 +----
28 fs/ocfs2/xattr.c | 42 ++++++++++++++----------------------------
29 16 files changed, 55 insertions(+), 94 deletions(-)
30
31Index: linux-2.6.27/fs/ocfs2/alloc.c
32===================================================================
33--- linux-2.6.27.orig/fs/ocfs2/alloc.c
34+++ linux-2.6.27/fs/ocfs2/alloc.c
35@@ -706,7 +706,7 @@ int ocfs2_num_free_extents(struct ocfs2_
36
37 if (last_eb_blk) {
38 retval = ocfs2_read_block(inode, last_eb_blk,
39- &eb_bh, OCFS2_BH_CACHED);
40+ &eb_bh);
41 if (retval < 0) {
42 mlog_errno(retval);
43 goto bail;
44@@ -1176,7 +1176,7 @@ static int ocfs2_find_branch_target(stru
45 brelse(bh);
46 bh = NULL;
47
48- status = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
49+ status = ocfs2_read_block(inode, blkno, &bh);
50 if (status < 0) {
51 mlog_errno(status);
52 goto bail;
53@@ -1549,7 +1549,7 @@ static int __ocfs2_find_path(struct inod
54
55 brelse(bh);
56 bh = NULL;
57- ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
58+ ret = ocfs2_read_block(inode, blkno, &bh);
59 if (ret) {
60 mlog_errno(ret);
61 goto out;
62@@ -4303,9 +4303,7 @@ static int ocfs2_figure_insert_type(stru
63 * ocfs2_figure_insert_type() and ocfs2_add_branch()
64 * may want it later.
65 */
66- ret = ocfs2_read_block(inode,
67- ocfs2_et_get_last_eb_blk(et), &bh,
68- OCFS2_BH_CACHED);
69+ ret = ocfs2_read_block(inode, ocfs2_et_get_last_eb_blk(et), &bh);
70 if (ret) {
71 mlog_exit(ret);
72 goto out;
73@@ -4771,9 +4769,8 @@ static int __ocfs2_mark_extent_written(s
74 if (path->p_tree_depth) {
75 struct ocfs2_extent_block *eb;
76
77- ret = ocfs2_read_block(inode,
78- ocfs2_et_get_last_eb_blk(et),
79- &last_eb_bh, OCFS2_BH_CACHED);
80+ ret = ocfs2_read_block(inode, ocfs2_et_get_last_eb_blk(et),
81+ &last_eb_bh);
82 if (ret) {
83 mlog_exit(ret);
84 goto out;
85@@ -4930,9 +4927,8 @@ static int ocfs2_split_tree(struct inode
86
87 depth = path->p_tree_depth;
88 if (depth > 0) {
89- ret = ocfs2_read_block(inode,
90- ocfs2_et_get_last_eb_blk(et),
91- &last_eb_bh, OCFS2_BH_CACHED);
92+ ret = ocfs2_read_block(inode, ocfs2_et_get_last_eb_blk(et),
93+ &last_eb_bh);
94 if (ret < 0) {
95 mlog_errno(ret);
96 goto out;
97@@ -5599,8 +5595,7 @@ static int ocfs2_get_truncate_log_info(s
98 goto bail;
99 }
100
101- status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
102- OCFS2_BH_CACHED);
103+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
104 if (status < 0) {
105 iput(inode);
106 mlog_errno(status);
107@@ -6999,7 +6994,7 @@ int ocfs2_prepare_truncate(struct ocfs2_
108
109 if (fe->id2.i_list.l_tree_depth) {
110 status = ocfs2_read_block(inode, le64_to_cpu(fe->i_last_eb_blk),
111- &last_eb_bh, OCFS2_BH_CACHED);
112+ &last_eb_bh);
113 if (status < 0) {
114 mlog_errno(status);
115 goto bail;
116Index: linux-2.6.27/fs/ocfs2/aops.c
117===================================================================
118--- linux-2.6.27.orig/fs/ocfs2/aops.c
119+++ linux-2.6.27/fs/ocfs2/aops.c
120@@ -68,8 +68,7 @@ static int ocfs2_symlink_get_block(struc
121 goto bail;
122 }
123
124- status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
125- &bh, OCFS2_BH_CACHED);
126+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
127 if (status < 0) {
128 mlog_errno(status);
129 goto bail;
130@@ -263,8 +262,7 @@ static int ocfs2_readpage_inline(struct
131 BUG_ON(!PageLocked(page));
132 BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
133
134- ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh,
135- OCFS2_BH_CACHED);
136+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
137 if (ret) {
138 mlog_errno(ret);
139 goto out;
140Index: linux-2.6.27/fs/ocfs2/buffer_head_io.h
141===================================================================
142--- linux-2.6.27.orig/fs/ocfs2/buffer_head_io.h
143+++ linux-2.6.27/fs/ocfs2/buffer_head_io.h
144@@ -33,8 +33,7 @@ void ocfs2_end_buffer_io_sync(struct buf
145
146 static inline int ocfs2_read_block(struct inode *inode,
147 u64 off,
148- struct buffer_head **bh,
149- int flags);
150+ struct buffer_head **bh);
151
152 int ocfs2_write_block(struct ocfs2_super *osb,
153 struct buffer_head *bh,
154@@ -54,7 +53,7 @@ int ocfs2_write_super_or_backup(struct o
155 #define OCFS2_BH_READAHEAD 8
156
157 static inline int ocfs2_read_block(struct inode *inode, u64 off,
158- struct buffer_head **bh, int flags)
159+ struct buffer_head **bh)
160 {
161 int status = 0;
162
163@@ -64,7 +63,7 @@ static inline int ocfs2_read_block(struc
164 goto bail;
165 }
166
167- status = ocfs2_read_blocks(inode, off, 1, bh, flags);
168+ status = ocfs2_read_blocks(inode, off, 1, bh, OCFS2_BH_CACHED);
169
170 bail:
171 return status;
172Index: linux-2.6.27/fs/ocfs2/dir.c
173===================================================================
174--- linux-2.6.27.orig/fs/ocfs2/dir.c
175+++ linux-2.6.27/fs/ocfs2/dir.c
176@@ -188,8 +188,7 @@ static struct buffer_head *ocfs2_find_en
177 struct ocfs2_dinode *di;
178 struct ocfs2_inline_data *data;
179
180- ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh,
181- OCFS2_BH_CACHED);
182+ ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh);
183 if (ret) {
184 mlog_errno(ret);
185 goto out;
186@@ -417,8 +416,7 @@ static inline int ocfs2_delete_entry_id(
187 struct ocfs2_dinode *di;
188 struct ocfs2_inline_data *data;
189
190- ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno,
191- &di_bh, OCFS2_BH_CACHED);
192+ ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh);
193 if (ret) {
194 mlog_errno(ret);
195 goto out;
196@@ -596,8 +594,7 @@ static int ocfs2_dir_foreach_blk_id(stru
197 struct ocfs2_inline_data *data;
198 struct ocfs2_dir_entry *de;
199
200- ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
201- &di_bh, OCFS2_BH_CACHED);
202+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
203 if (ret) {
204 mlog(ML_ERROR, "Unable to read inode block for dir %llu\n",
205 (unsigned long long)OCFS2_I(inode)->ip_blkno);
206Index: linux-2.6.27/fs/ocfs2/dlmglue.c
207===================================================================
208--- linux-2.6.27.orig/fs/ocfs2/dlmglue.c
209+++ linux-2.6.27/fs/ocfs2/dlmglue.c
210@@ -2024,8 +2024,7 @@ static int ocfs2_inode_lock_update(struc
211 } else {
212 /* Boo, we have to go to disk. */
213 /* read bh, cast, ocfs2_refresh_inode */
214- status = ocfs2_read_block(inode, oi->ip_blkno,
215- bh, OCFS2_BH_CACHED);
216+ status = ocfs2_read_block(inode, oi->ip_blkno, bh);
217 if (status < 0) {
218 mlog_errno(status);
219 goto bail_refresh;
220@@ -2086,10 +2085,7 @@ static int ocfs2_assign_bh(struct inode
221 return 0;
222 }
223
224- status = ocfs2_read_block(inode,
225- OCFS2_I(inode)->ip_blkno,
226- ret_bh,
227- OCFS2_BH_CACHED);
228+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, ret_bh);
229 if (status < 0)
230 mlog_errno(status);
231
232Index: linux-2.6.27/fs/ocfs2/extent_map.c
233===================================================================
234--- linux-2.6.27.orig/fs/ocfs2/extent_map.c
235+++ linux-2.6.27/fs/ocfs2/extent_map.c
236@@ -337,7 +337,7 @@ static int ocfs2_figure_hole_clusters(st
237
238 ret = ocfs2_read_block(inode,
239 le64_to_cpu(eb->h_next_leaf_blk),
240- &next_eb_bh, OCFS2_BH_CACHED);
241+ &next_eb_bh);
242 if (ret) {
243 mlog_errno(ret);
244 goto out;
245@@ -458,8 +458,7 @@ int ocfs2_get_clusters(struct inode *ino
246 if (ret == 0)
247 goto out;
248
249- ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
250- &di_bh, OCFS2_BH_CACHED);
251+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
252 if (ret) {
253 mlog_errno(ret);
254 goto out;
255Index: linux-2.6.27/fs/ocfs2/file.c
256===================================================================
257--- linux-2.6.27.orig/fs/ocfs2/file.c
258+++ linux-2.6.27/fs/ocfs2/file.c
259@@ -545,8 +545,7 @@ static int __ocfs2_extend_allocation(str
260 */
261 BUG_ON(mark_unwritten && !ocfs2_sparse_alloc(osb));
262
263- status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
264- OCFS2_BH_CACHED);
265+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
266 if (status < 0) {
267 mlog_errno(status);
268 goto leave;
269@@ -1132,7 +1131,7 @@ static int ocfs2_write_remove_suid(struc
270 struct buffer_head *bh = NULL;
271 struct ocfs2_inode_info *oi = OCFS2_I(inode);
272
273- ret = ocfs2_read_block(inode, oi->ip_blkno, &bh, OCFS2_BH_CACHED);
274+ ret = ocfs2_read_block(inode, oi->ip_blkno, &bh);
275 if (ret < 0) {
276 mlog_errno(ret);
277 goto out;
278@@ -1159,7 +1158,7 @@ static int ocfs2_allocate_unwritten_exte
279
280 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
281 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
282- &di_bh, OCFS2_BH_CACHED);
283+ &di_bh);
284 if (ret) {
285 mlog_errno(ret);
286 goto out;
287Index: linux-2.6.27/fs/ocfs2/inode.c
288===================================================================
289--- linux-2.6.27.orig/fs/ocfs2/inode.c
290+++ linux-2.6.27/fs/ocfs2/inode.c
291@@ -461,7 +461,7 @@ static int ocfs2_read_locked_inode(struc
292 }
293
294 if (can_lock)
295- status = ocfs2_read_block(inode, args->fi_blkno, &bh, 0);
296+ status = ocfs2_read_blocks(inode, args->fi_blkno, 1, &bh, 0);
297 else
298 status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
299 if (status < 0) {
300@@ -1165,7 +1165,7 @@ struct buffer_head *ocfs2_bread(struct i
301 goto fail;
302 }
303
304- tmperr = ocfs2_read_block(inode, p_blkno, &bh, readflags);
305+ tmperr = ocfs2_read_blocks(inode, p_blkno, 1, &bh, readflags);
306 if (tmperr < 0)
307 goto fail;
308
309Index: linux-2.6.27/fs/ocfs2/journal.c
310===================================================================
311--- linux-2.6.27.orig/fs/ocfs2/journal.c
312+++ linux-2.6.27/fs/ocfs2/journal.c
313@@ -1134,7 +1134,7 @@ static int ocfs2_read_journal_inode(stru
314 }
315 SET_INODE_JOURNAL(inode);
316
317- status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, bh, 0);
318+ status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1, bh, 0);
319 if (status < 0) {
320 mlog_errno(status);
321 goto bail;
322Index: linux-2.6.27/fs/ocfs2/localalloc.c
323===================================================================
324--- linux-2.6.27.orig/fs/ocfs2/localalloc.c
325+++ linux-2.6.27/fs/ocfs2/localalloc.c
326@@ -248,8 +248,8 @@ int ocfs2_load_local_alloc(struct ocfs2_
327 goto bail;
328 }
329
330- status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
331- &alloc_bh, 0);
332+ status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1,
333+ &alloc_bh, 0);
334 if (status < 0) {
335 mlog_errno(status);
336 goto bail;
337@@ -459,8 +459,8 @@ int ocfs2_begin_local_alloc_recovery(str
338
339 mutex_lock(&inode->i_mutex);
340
341- status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
342- &alloc_bh, 0);
343+ status = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1,
344+ &alloc_bh, 0);
345 if (status < 0) {
346 mlog_errno(status);
347 goto bail;
348Index: linux-2.6.27/fs/ocfs2/namei.c
349===================================================================
350--- linux-2.6.27.orig/fs/ocfs2/namei.c
351+++ linux-2.6.27/fs/ocfs2/namei.c
352@@ -1754,7 +1754,7 @@ static int ocfs2_orphan_add(struct ocfs2
353
354 status = ocfs2_read_block(orphan_dir_inode,
355 OCFS2_I(orphan_dir_inode)->ip_blkno,
356- &orphan_dir_bh, OCFS2_BH_CACHED);
357+ &orphan_dir_bh);
358 if (status < 0) {
359 mlog_errno(status);
360 goto leave;
361Index: linux-2.6.27/fs/ocfs2/resize.c
362===================================================================
363--- linux-2.6.27.orig/fs/ocfs2/resize.c
364+++ linux-2.6.27/fs/ocfs2/resize.c
365@@ -332,8 +332,7 @@ int ocfs2_group_extend(struct inode * in
366 lgd_blkno = ocfs2_which_cluster_group(main_bm_inode,
367 first_new_cluster - 1);
368
369- ret = ocfs2_read_block(main_bm_inode, lgd_blkno, &group_bh,
370- OCFS2_BH_CACHED);
371+ ret = ocfs2_read_block(main_bm_inode, lgd_blkno, &group_bh);
372 if (ret < 0) {
373 mlog_errno(ret);
374 goto out_unlock;
375Index: linux-2.6.27/fs/ocfs2/slot_map.c
376===================================================================
377--- linux-2.6.27.orig/fs/ocfs2/slot_map.c
378+++ linux-2.6.27/fs/ocfs2/slot_map.c
379@@ -403,7 +403,7 @@ static int ocfs2_map_slot_buffers(struct
380 (unsigned long long)blkno);
381
382 bh = NULL; /* Acquire a fresh bh */
383- status = ocfs2_read_block(si->si_inode, blkno, &bh, 0);
384+ status = ocfs2_read_blocks(si->si_inode, blkno, 1, &bh, 0);
385 if (status < 0) {
386 mlog_errno(status);
387 goto bail;
388Index: linux-2.6.27/fs/ocfs2/suballoc.c
389===================================================================
390--- linux-2.6.27.orig/fs/ocfs2/suballoc.c
391+++ linux-2.6.27/fs/ocfs2/suballoc.c
392@@ -1172,8 +1172,7 @@ static int ocfs2_search_one_group(struct
393 struct ocfs2_group_desc *gd;
394 struct inode *alloc_inode = ac->ac_inode;
395
396- ret = ocfs2_read_block(alloc_inode, gd_blkno,
397- &group_bh, OCFS2_BH_CACHED);
398+ ret = ocfs2_read_block(alloc_inode, gd_blkno, &group_bh);
399 if (ret < 0) {
400 mlog_errno(ret);
401 return ret;
402@@ -1244,7 +1243,7 @@ static int ocfs2_search_chain(struct ocf
403
404 status = ocfs2_read_block(alloc_inode,
405 le64_to_cpu(cl->cl_recs[chain].c_blkno),
406- &group_bh, OCFS2_BH_CACHED);
407+ &group_bh);
408 if (status < 0) {
409 mlog_errno(status);
410 goto bail;
411@@ -1273,8 +1272,7 @@ static int ocfs2_search_chain(struct ocf
412 prev_group_bh = group_bh;
413 group_bh = NULL;
414 status = ocfs2_read_block(alloc_inode,
415- next_group, &group_bh,
416- OCFS2_BH_CACHED);
417+ next_group, &group_bh);
418 if (status < 0) {
419 mlog_errno(status);
420 goto bail;
421@@ -1795,8 +1793,7 @@ int ocfs2_free_suballoc_bits(handle_t *h
422 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count,
423 (unsigned long long)bg_blkno, start_bit);
424
425- status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh,
426- OCFS2_BH_CACHED);
427+ status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh);
428 if (status < 0) {
429 mlog_errno(status);
430 goto bail;
431Index: linux-2.6.27/fs/ocfs2/symlink.c
432===================================================================
433--- linux-2.6.27.orig/fs/ocfs2/symlink.c
434+++ linux-2.6.27/fs/ocfs2/symlink.c
435@@ -84,10 +84,7 @@ static char *ocfs2_fast_symlink_getlink(
436
437 mlog_entry_void();
438
439- status = ocfs2_read_block(inode,
440- OCFS2_I(inode)->ip_blkno,
441- bh,
442- OCFS2_BH_CACHED);
443+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, bh);
444 if (status < 0) {
445 mlog_errno(status);
446 link = ERR_PTR(status);
447Index: linux-2.6.27/fs/ocfs2/xattr.c
448===================================================================
449--- linux-2.6.27.orig/fs/ocfs2/xattr.c
450+++ linux-2.6.27/fs/ocfs2/xattr.c
451@@ -553,9 +553,7 @@ static int ocfs2_xattr_block_list(struct
452 if (!di->i_xattr_loc)
453 return ret;
454
455- ret = ocfs2_read_block(inode,
456- le64_to_cpu(di->i_xattr_loc),
457- &blk_bh, OCFS2_BH_CACHED);
458+ ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh);
459 if (ret < 0) {
460 mlog_errno(ret);
461 return ret;
462@@ -688,8 +686,7 @@ static int ocfs2_xattr_get_value_outside
463 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
464 /* Copy ocfs2_xattr_value */
465 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
466- ret = ocfs2_read_block(inode, blkno,
467- &bh, OCFS2_BH_CACHED);
468+ ret = ocfs2_read_block(inode, blkno, &bh);
469 if (ret) {
470 mlog_errno(ret);
471 goto out;
472@@ -780,9 +777,7 @@ static int ocfs2_xattr_block_get(struct
473
474 memset(&xs->bucket, 0, sizeof(xs->bucket));
475
476- ret = ocfs2_read_block(inode,
477- le64_to_cpu(di->i_xattr_loc),
478- &blk_bh, OCFS2_BH_CACHED);
479+ ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh);
480 if (ret < 0) {
481 mlog_errno(ret);
482 return ret;
483@@ -938,8 +933,7 @@ static int __ocfs2_xattr_set_value_outsi
484 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
485
486 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
487- ret = ocfs2_read_block(inode, blkno,
488- &bh, OCFS2_BH_CACHED);
489+ ret = ocfs2_read_block(inode, blkno, &bh);
490 if (ret) {
491 mlog_errno(ret);
492 goto out_commit;
493@@ -1530,8 +1524,7 @@ static int ocfs2_xattr_free_block(struct
494 u64 blk, bg_blkno;
495 u16 bit;
496
497- ret = ocfs2_read_block(inode, block, &blk_bh,
498- OCFS2_BH_CACHED);
499+ ret = ocfs2_read_block(inode, block, &blk_bh);
500 if (ret < 0) {
501 mlog_errno(ret);
502 goto out;
503@@ -1789,9 +1782,7 @@ static int ocfs2_xattr_block_find(struct
504 if (!di->i_xattr_loc)
505 return ret;
506
507- ret = ocfs2_read_block(inode,
508- le64_to_cpu(di->i_xattr_loc),
509- &blk_bh, OCFS2_BH_CACHED);
510+ ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh);
511 if (ret < 0) {
512 mlog_errno(ret);
513 return ret;
514@@ -2232,9 +2223,8 @@ static int ocfs2_find_xe_in_bucket(struc
515 break;
516 }
517
518- ret = ocfs2_read_block(inode,
519- header_bh->b_blocknr + block_off,
520- &name_bh, OCFS2_BH_CACHED);
521+ ret = ocfs2_read_block(inode, header_bh->b_blocknr + block_off,
522+ &name_bh);
523 if (ret) {
524 mlog_errno(ret);
525 break;
526@@ -2285,7 +2275,7 @@ static int ocfs2_xattr_bucket_find(struc
527 u32 last_hash;
528 u64 blkno;
529
530- ret = ocfs2_read_block(inode, p_blkno, &bh, OCFS2_BH_CACHED);
531+ ret = ocfs2_read_block(inode, p_blkno, &bh);
532 if (ret) {
533 mlog_errno(ret);
534 goto out;
535@@ -2301,7 +2291,7 @@ static int ocfs2_xattr_bucket_find(struc
536
537 blkno = p_blkno + bucket * blk_per_bucket;
538
539- ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
540+ ret = ocfs2_read_block(inode, blkno, &bh);
541 if (ret) {
542 mlog_errno(ret);
543 goto out;
544@@ -2914,7 +2904,6 @@ static int ocfs2_defrag_xattr_bucket(str
545 u64 blkno = bucket->bhs[0]->b_blocknr;
546 u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
547 u16 xh_free_start;
548- struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
549 size_t blocksize = inode->i_sb->s_blocksize;
550 handle_t *handle;
551 struct buffer_head **bhs;
552@@ -3126,8 +3115,7 @@ static int ocfs2_mv_xattr_bucket_cross_c
553 goto out;
554 }
555
556- ret = ocfs2_read_block(inode, prev_blkno,
557- &old_bh, OCFS2_BH_CACHED);
558+ ret = ocfs2_read_block(inode, prev_blkno, &old_bh);
559 if (ret < 0) {
560 mlog_errno(ret);
561 brelse(new_bh);
562@@ -3497,7 +3485,7 @@ static int ocfs2_cp_xattr_cluster(struct
563 ocfs2_journal_dirty(handle, first_bh);
564
565 /* update the new bucket header. */
566- ret = ocfs2_read_block(inode, to_blk_start, &bh, OCFS2_BH_CACHED);
567+ ret = ocfs2_read_block(inode, to_blk_start, &bh);
568 if (ret < 0) {
569 mlog_errno(ret);
570 goto out;
571@@ -3884,8 +3872,7 @@ static int ocfs2_add_new_xattr_bucket(st
572 goto out;
573 }
574
575- ret = ocfs2_read_block(inode, p_blkno,
576- &first_bh, OCFS2_BH_CACHED);
577+ ret = ocfs2_read_block(inode, p_blkno, &first_bh);
578 if (ret) {
579 mlog_errno(ret);
580 goto out;
581@@ -4236,8 +4223,7 @@ static int ocfs2_xattr_bucket_value_trun
582 BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize);
583 value_blk += header_bh->b_blocknr;
584
585- ret = ocfs2_read_block(inode, value_blk,
586- &value_bh, OCFS2_BH_CACHED);
587+ ret = ocfs2_read_block(inode, value_blk, &value_bh);
588 if (ret) {
589 mlog_errno(ret);
590 goto out;