aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-10-09 20:20:30 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-14 14:43:29 -0400
commit31d33073ca38603dea705dae45e094a64ca062d6 (patch)
treecf02beb489456ebc9e07bace80e96ad1150f2cbf
parentda1e90985a0e767e44397c9db0937e236033fa58 (diff)
ocfs2: Require an inode for ocfs2_read_block(s)().
Now that synchronous readers are using ocfs2_read_blocks_sync(), all callers of ocfs2_read_blocks() are passing an inode. Use it unconditionally. Since it's there, we don't need to pass the ocfs2_super either. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
-rw-r--r--fs/ocfs2/alloc.c30
-rw-r--r--fs/ocfs2/aops.c10
-rw-r--r--fs/ocfs2/buffer_head_io.c35
-rw-r--r--fs/ocfs2/buffer_head_io.h18
-rw-r--r--fs/ocfs2/dir.c12
-rw-r--r--fs/ocfs2/dlmglue.c9
-rw-r--r--fs/ocfs2/extent_map.c12
-rw-r--r--fs/ocfs2/file.c12
-rw-r--r--fs/ocfs2/inode.c6
-rw-r--r--fs/ocfs2/journal.c2
-rw-r--r--fs/ocfs2/localalloc.c8
-rw-r--r--fs/ocfs2/namei.c5
-rw-r--r--fs/ocfs2/resize.c4
-rw-r--r--fs/ocfs2/slot_map.c5
-rw-r--r--fs/ocfs2/suballoc.c17
-rw-r--r--fs/ocfs2/symlink.c5
-rw-r--r--fs/ocfs2/xattr.c74
17 files changed, 116 insertions, 148 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 052c4cf7db95..a164e09491f8 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -705,8 +705,8 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
705 last_eb_blk = ocfs2_et_get_last_eb_blk(et); 705 last_eb_blk = ocfs2_et_get_last_eb_blk(et);
706 706
707 if (last_eb_blk) { 707 if (last_eb_blk) {
708 retval = ocfs2_read_block(osb, last_eb_blk, 708 retval = ocfs2_read_block(inode, last_eb_blk,
709 &eb_bh, OCFS2_BH_CACHED, inode); 709 &eb_bh, OCFS2_BH_CACHED);
710 if (retval < 0) { 710 if (retval < 0) {
711 mlog_errno(retval); 711 mlog_errno(retval);
712 goto bail; 712 goto bail;
@@ -1176,8 +1176,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
1176 brelse(bh); 1176 brelse(bh);
1177 bh = NULL; 1177 bh = NULL;
1178 1178
1179 status = ocfs2_read_block(osb, blkno, &bh, OCFS2_BH_CACHED, 1179 status = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
1180 inode);
1181 if (status < 0) { 1180 if (status < 0) {
1182 mlog_errno(status); 1181 mlog_errno(status);
1183 goto bail; 1182 goto bail;
@@ -1541,8 +1540,7 @@ static int __ocfs2_find_path(struct inode *inode,
1541 1540
1542 brelse(bh); 1541 brelse(bh);
1543 bh = NULL; 1542 bh = NULL;
1544 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, 1543 ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
1545 &bh, OCFS2_BH_CACHED, inode);
1546 if (ret) { 1544 if (ret) {
1547 mlog_errno(ret); 1545 mlog_errno(ret);
1548 goto out; 1546 goto out;
@@ -4296,9 +4294,9 @@ static int ocfs2_figure_insert_type(struct inode *inode,
4296 * ocfs2_figure_insert_type() and ocfs2_add_branch() 4294 * ocfs2_figure_insert_type() and ocfs2_add_branch()
4297 * may want it later. 4295 * may want it later.
4298 */ 4296 */
4299 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 4297 ret = ocfs2_read_block(inode,
4300 ocfs2_et_get_last_eb_blk(et), &bh, 4298 ocfs2_et_get_last_eb_blk(et), &bh,
4301 OCFS2_BH_CACHED, inode); 4299 OCFS2_BH_CACHED);
4302 if (ret) { 4300 if (ret) {
4303 mlog_exit(ret); 4301 mlog_exit(ret);
4304 goto out; 4302 goto out;
@@ -4764,9 +4762,9 @@ static int __ocfs2_mark_extent_written(struct inode *inode,
4764 if (path->p_tree_depth) { 4762 if (path->p_tree_depth) {
4765 struct ocfs2_extent_block *eb; 4763 struct ocfs2_extent_block *eb;
4766 4764
4767 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 4765 ret = ocfs2_read_block(inode,
4768 ocfs2_et_get_last_eb_blk(et), 4766 ocfs2_et_get_last_eb_blk(et),
4769 &last_eb_bh, OCFS2_BH_CACHED, inode); 4767 &last_eb_bh, OCFS2_BH_CACHED);
4770 if (ret) { 4768 if (ret) {
4771 mlog_exit(ret); 4769 mlog_exit(ret);
4772 goto out; 4770 goto out;
@@ -4923,9 +4921,9 @@ static int ocfs2_split_tree(struct inode *inode, struct ocfs2_extent_tree *et,
4923 4921
4924 depth = path->p_tree_depth; 4922 depth = path->p_tree_depth;
4925 if (depth > 0) { 4923 if (depth > 0) {
4926 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 4924 ret = ocfs2_read_block(inode,
4927 ocfs2_et_get_last_eb_blk(et), 4925 ocfs2_et_get_last_eb_blk(et),
4928 &last_eb_bh, OCFS2_BH_CACHED, inode); 4926 &last_eb_bh, OCFS2_BH_CACHED);
4929 if (ret < 0) { 4927 if (ret < 0) {
4930 mlog_errno(ret); 4928 mlog_errno(ret);
4931 goto out; 4929 goto out;
@@ -5592,8 +5590,8 @@ static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
5592 goto bail; 5590 goto bail;
5593 } 5591 }
5594 5592
5595 status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh, 5593 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
5596 OCFS2_BH_CACHED, inode); 5594 OCFS2_BH_CACHED);
5597 if (status < 0) { 5595 if (status < 0) {
5598 iput(inode); 5596 iput(inode);
5599 mlog_errno(status); 5597 mlog_errno(status);
@@ -6991,8 +6989,8 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
6991 ocfs2_init_dealloc_ctxt(&(*tc)->tc_dealloc); 6989 ocfs2_init_dealloc_ctxt(&(*tc)->tc_dealloc);
6992 6990
6993 if (fe->id2.i_list.l_tree_depth) { 6991 if (fe->id2.i_list.l_tree_depth) {
6994 status = ocfs2_read_block(osb, le64_to_cpu(fe->i_last_eb_blk), 6992 status = ocfs2_read_block(inode, le64_to_cpu(fe->i_last_eb_blk),
6995 &last_eb_bh, OCFS2_BH_CACHED, inode); 6993 &last_eb_bh, OCFS2_BH_CACHED);
6996 if (status < 0) { 6994 if (status < 0) {
6997 mlog_errno(status); 6995 mlog_errno(status);
6998 goto bail; 6996 goto bail;
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 98e16fb49e4b..f232a0e3c30f 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -68,9 +68,8 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
68 goto bail; 68 goto bail;
69 } 69 }
70 70
71 status = ocfs2_read_block(OCFS2_SB(inode->i_sb), 71 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
72 OCFS2_I(inode)->ip_blkno, 72 &bh, OCFS2_BH_CACHED);
73 &bh, OCFS2_BH_CACHED, inode);
74 if (status < 0) { 73 if (status < 0) {
75 mlog_errno(status); 74 mlog_errno(status);
76 goto bail; 75 goto bail;
@@ -260,13 +259,12 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
260{ 259{
261 int ret; 260 int ret;
262 struct buffer_head *di_bh = NULL; 261 struct buffer_head *di_bh = NULL;
263 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
264 262
265 BUG_ON(!PageLocked(page)); 263 BUG_ON(!PageLocked(page));
266 BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)); 264 BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
267 265
268 ret = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &di_bh, 266 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh,
269 OCFS2_BH_CACHED, inode); 267 OCFS2_BH_CACHED);
270 if (ret) { 268 if (ret) {
271 mlog_errno(ret); 269 mlog_errno(ret);
272 goto out; 270 goto out;
diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index ca4ab7ce85bf..718dbe5607ca 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -170,22 +170,20 @@ bail:
170 return status; 170 return status;
171} 171}
172 172
173int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr, 173int ocfs2_read_blocks(struct inode *inode, u64 block, int nr,
174 struct buffer_head *bhs[], int flags, 174 struct buffer_head *bhs[], int flags)
175 struct inode *inode)
176{ 175{
177 int status = 0; 176 int status = 0;
178 struct super_block *sb;
179 int i, ignore_cache = 0; 177 int i, ignore_cache = 0;
180 struct buffer_head *bh; 178 struct buffer_head *bh;
181 179
182 mlog_entry("(block=(%llu), nr=(%d), flags=%d, inode=%p)\n", 180 mlog_entry("(inode=%p, block=(%llu), nr=(%d), flags=%d)\n",
183 (unsigned long long)block, nr, flags, inode); 181 inode, (unsigned long long)block, nr, flags);
184 182
185 BUG_ON((flags & OCFS2_BH_READAHEAD) && 183 BUG_ON(!inode);
186 (!inode || !(flags & OCFS2_BH_CACHED))); 184 BUG_ON((flags & OCFS2_BH_READAHEAD) && !(flags & OCFS2_BH_CACHED));
187 185
188 if (osb == NULL || osb->sb == NULL || bhs == NULL) { 186 if (bhs == NULL) {
189 status = -EINVAL; 187 status = -EINVAL;
190 mlog_errno(status); 188 mlog_errno(status);
191 goto bail; 189 goto bail;
@@ -204,19 +202,12 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr,
204 goto bail; 202 goto bail;
205 } 203 }
206 204
207 sb = osb->sb; 205 mutex_lock(&OCFS2_I(inode)->ip_io_mutex);
208
209 if (flags & OCFS2_BH_CACHED && !inode)
210 flags &= ~OCFS2_BH_CACHED;
211
212 if (inode)
213 mutex_lock(&OCFS2_I(inode)->ip_io_mutex);
214 for (i = 0 ; i < nr ; i++) { 206 for (i = 0 ; i < nr ; i++) {
215 if (bhs[i] == NULL) { 207 if (bhs[i] == NULL) {
216 bhs[i] = sb_getblk(sb, block++); 208 bhs[i] = sb_getblk(inode->i_sb, block++);
217 if (bhs[i] == NULL) { 209 if (bhs[i] == NULL) {
218 if (inode) 210 mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
219 mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
220 status = -EIO; 211 status = -EIO;
221 mlog_errno(status); 212 mlog_errno(status);
222 goto bail; 213 goto bail;
@@ -347,11 +338,9 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr,
347 /* Always set the buffer in the cache, even if it was 338 /* Always set the buffer in the cache, even if it was
348 * a forced read, or read-ahead which hasn't yet 339 * a forced read, or read-ahead which hasn't yet
349 * completed. */ 340 * completed. */
350 if (inode) 341 ocfs2_set_buffer_uptodate(inode, bh);
351 ocfs2_set_buffer_uptodate(inode, bh);
352 } 342 }
353 if (inode) 343 mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
354 mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
355 344
356 mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s, flags=0x%x\n", 345 mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s, flags=0x%x\n",
357 (unsigned long long)block, nr, 346 (unsigned long long)block, nr,
diff --git a/fs/ocfs2/buffer_head_io.h b/fs/ocfs2/buffer_head_io.h
index 71646b470ac8..fd0d774ac356 100644
--- a/fs/ocfs2/buffer_head_io.h
+++ b/fs/ocfs2/buffer_head_io.h
@@ -31,21 +31,19 @@
31void ocfs2_end_buffer_io_sync(struct buffer_head *bh, 31void ocfs2_end_buffer_io_sync(struct buffer_head *bh,
32 int uptodate); 32 int uptodate);
33 33
34static inline int ocfs2_read_block(struct ocfs2_super *osb, 34static inline int ocfs2_read_block(struct inode *inode,
35 u64 off, 35 u64 off,
36 struct buffer_head **bh, 36 struct buffer_head **bh,
37 int flags, 37 int flags);
38 struct inode *inode);
39 38
40int ocfs2_write_block(struct ocfs2_super *osb, 39int ocfs2_write_block(struct ocfs2_super *osb,
41 struct buffer_head *bh, 40 struct buffer_head *bh,
42 struct inode *inode); 41 struct inode *inode);
43int ocfs2_read_blocks(struct ocfs2_super *osb, 42int ocfs2_read_blocks(struct inode *inode,
44 u64 block, 43 u64 block,
45 int nr, 44 int nr,
46 struct buffer_head *bhs[], 45 struct buffer_head *bhs[],
47 int flags, 46 int flags);
48 struct inode *inode);
49int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, 47int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
50 unsigned int nr, struct buffer_head *bhs[]); 48 unsigned int nr, struct buffer_head *bhs[]);
51 49
@@ -55,9 +53,8 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
55#define OCFS2_BH_CACHED 1 53#define OCFS2_BH_CACHED 1
56#define OCFS2_BH_READAHEAD 8 54#define OCFS2_BH_READAHEAD 8
57 55
58static inline int ocfs2_read_block(struct ocfs2_super * osb, u64 off, 56static inline int ocfs2_read_block(struct inode *inode, u64 off,
59 struct buffer_head **bh, int flags, 57 struct buffer_head **bh, int flags)
60 struct inode *inode)
61{ 58{
62 int status = 0; 59 int status = 0;
63 60
@@ -67,8 +64,7 @@ static inline int ocfs2_read_block(struct ocfs2_super * osb, u64 off,
67 goto bail; 64 goto bail;
68 } 65 }
69 66
70 status = ocfs2_read_blocks(osb, off, 1, bh, 67 status = ocfs2_read_blocks(inode, off, 1, bh, flags);
71 flags, inode);
72 68
73bail: 69bail:
74 return status; 70 return status;
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 3614651dcdb2..828437ca91ba 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -188,8 +188,8 @@ static struct buffer_head *ocfs2_find_entry_id(const char *name,
188 struct ocfs2_dinode *di; 188 struct ocfs2_dinode *di;
189 struct ocfs2_inline_data *data; 189 struct ocfs2_inline_data *data;
190 190
191 ret = ocfs2_read_block(OCFS2_SB(dir->i_sb), OCFS2_I(dir)->ip_blkno, 191 ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh,
192 &di_bh, OCFS2_BH_CACHED, dir); 192 OCFS2_BH_CACHED);
193 if (ret) { 193 if (ret) {
194 mlog_errno(ret); 194 mlog_errno(ret);
195 goto out; 195 goto out;
@@ -417,8 +417,8 @@ static inline int ocfs2_delete_entry_id(handle_t *handle,
417 struct ocfs2_dinode *di; 417 struct ocfs2_dinode *di;
418 struct ocfs2_inline_data *data; 418 struct ocfs2_inline_data *data;
419 419
420 ret = ocfs2_read_block(OCFS2_SB(dir->i_sb), OCFS2_I(dir)->ip_blkno, 420 ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno,
421 &di_bh, OCFS2_BH_CACHED, dir); 421 &di_bh, OCFS2_BH_CACHED);
422 if (ret) { 422 if (ret) {
423 mlog_errno(ret); 423 mlog_errno(ret);
424 goto out; 424 goto out;
@@ -596,8 +596,8 @@ static int ocfs2_dir_foreach_blk_id(struct inode *inode,
596 struct ocfs2_inline_data *data; 596 struct ocfs2_inline_data *data;
597 struct ocfs2_dir_entry *de; 597 struct ocfs2_dir_entry *de;
598 598
599 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), OCFS2_I(inode)->ip_blkno, 599 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
600 &di_bh, OCFS2_BH_CACHED, inode); 600 &di_bh, OCFS2_BH_CACHED);
601 if (ret) { 601 if (ret) {
602 mlog(ML_ERROR, "Unable to read inode block for dir %llu\n", 602 mlog(ML_ERROR, "Unable to read inode block for dir %llu\n",
603 (unsigned long long)OCFS2_I(inode)->ip_blkno); 603 (unsigned long long)OCFS2_I(inode)->ip_blkno);
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index eae3d643a5e4..3b2cd0f87210 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2024,8 +2024,8 @@ static int ocfs2_inode_lock_update(struct inode *inode,
2024 } else { 2024 } else {
2025 /* Boo, we have to go to disk. */ 2025 /* Boo, we have to go to disk. */
2026 /* read bh, cast, ocfs2_refresh_inode */ 2026 /* read bh, cast, ocfs2_refresh_inode */
2027 status = ocfs2_read_block(OCFS2_SB(inode->i_sb), oi->ip_blkno, 2027 status = ocfs2_read_block(inode, oi->ip_blkno,
2028 bh, OCFS2_BH_CACHED, inode); 2028 bh, OCFS2_BH_CACHED);
2029 if (status < 0) { 2029 if (status < 0) {
2030 mlog_errno(status); 2030 mlog_errno(status);
2031 goto bail_refresh; 2031 goto bail_refresh;
@@ -2086,11 +2086,10 @@ static int ocfs2_assign_bh(struct inode *inode,
2086 return 0; 2086 return 0;
2087 } 2087 }
2088 2088
2089 status = ocfs2_read_block(OCFS2_SB(inode->i_sb), 2089 status = ocfs2_read_block(inode,
2090 OCFS2_I(inode)->ip_blkno, 2090 OCFS2_I(inode)->ip_blkno,
2091 ret_bh, 2091 ret_bh,
2092 OCFS2_BH_CACHED, 2092 OCFS2_BH_CACHED);
2093 inode);
2094 if (status < 0) 2093 if (status < 0)
2095 mlog_errno(status); 2094 mlog_errno(status);
2096 2095
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index a7b1cfa735bf..5b482214bb75 100644
--- a/fs/ocfs2/extent_map.c
+++ b/fs/ocfs2/extent_map.c
@@ -293,8 +293,8 @@ static int ocfs2_last_eb_is_empty(struct inode *inode,
293 struct ocfs2_extent_block *eb; 293 struct ocfs2_extent_block *eb;
294 struct ocfs2_extent_list *el; 294 struct ocfs2_extent_list *el;
295 295
296 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), last_eb_blk, 296 ret = ocfs2_read_block(inode, last_eb_blk,
297 &eb_bh, OCFS2_BH_CACHED, inode); 297 &eb_bh, OCFS2_BH_CACHED);
298 if (ret) { 298 if (ret) {
299 mlog_errno(ret); 299 mlog_errno(ret);
300 goto out; 300 goto out;
@@ -382,9 +382,9 @@ static int ocfs2_figure_hole_clusters(struct inode *inode,
382 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) 382 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL)
383 goto no_more_extents; 383 goto no_more_extents;
384 384
385 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 385 ret = ocfs2_read_block(inode,
386 le64_to_cpu(eb->h_next_leaf_blk), 386 le64_to_cpu(eb->h_next_leaf_blk),
387 &next_eb_bh, OCFS2_BH_CACHED, inode); 387 &next_eb_bh, OCFS2_BH_CACHED);
388 if (ret) { 388 if (ret) {
389 mlog_errno(ret); 389 mlog_errno(ret);
390 goto out; 390 goto out;
@@ -631,8 +631,8 @@ int ocfs2_get_clusters(struct inode *inode, u32 v_cluster,
631 if (ret == 0) 631 if (ret == 0)
632 goto out; 632 goto out;
633 633
634 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), OCFS2_I(inode)->ip_blkno, 634 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
635 &di_bh, OCFS2_BH_CACHED, inode); 635 &di_bh, OCFS2_BH_CACHED);
636 if (ret) { 636 if (ret) {
637 mlog_errno(ret); 637 mlog_errno(ret);
638 goto out; 638 goto out;
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 408d5a66591d..7a809be54e84 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -545,8 +545,8 @@ 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(osb, OCFS2_I(inode)->ip_blkno, &bh, 548 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
549 OCFS2_BH_CACHED, inode); 549 OCFS2_BH_CACHED);
550 if (status < 0) { 550 if (status < 0) {
551 mlog_errno(status); 551 mlog_errno(status);
552 goto leave; 552 goto leave;
@@ -1132,8 +1132,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
1132 struct buffer_head *bh = NULL; 1132 struct buffer_head *bh = NULL;
1133 struct ocfs2_inode_info *oi = OCFS2_I(inode); 1133 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1134 1134
1135 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 1135 ret = ocfs2_read_block(inode, oi->ip_blkno, &bh, OCFS2_BH_CACHED);
1136 oi->ip_blkno, &bh, OCFS2_BH_CACHED, inode);
1137 if (ret < 0) { 1136 if (ret < 0) {
1138 mlog_errno(ret); 1137 mlog_errno(ret);
1139 goto out; 1138 goto out;
@@ -1159,9 +1158,8 @@ static int ocfs2_allocate_unwritten_extents(struct inode *inode,
1159 struct buffer_head *di_bh = NULL; 1158 struct buffer_head *di_bh = NULL;
1160 1159
1161 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { 1160 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
1162 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 1161 ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
1163 OCFS2_I(inode)->ip_blkno, &di_bh, 1162 &di_bh, OCFS2_BH_CACHED);
1164 OCFS2_BH_CACHED, inode);
1165 if (ret) { 1163 if (ret) {
1166 mlog_errno(ret); 1164 mlog_errno(ret);
1167 goto out; 1165 goto out;
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 522297033945..6ec31b92a47f 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -461,8 +461,7 @@ static int ocfs2_read_locked_inode(struct inode *inode,
461 } 461 }
462 462
463 if (can_lock) 463 if (can_lock)
464 status = ocfs2_read_block(osb, args->fi_blkno, &bh, 0, 464 status = ocfs2_read_block(inode, args->fi_blkno, &bh, 0);
465 inode);
466 else 465 else
467 status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh); 466 status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
468 if (status < 0) { 467 if (status < 0) {
@@ -1166,8 +1165,7 @@ struct buffer_head *ocfs2_bread(struct inode *inode,
1166 goto fail; 1165 goto fail;
1167 } 1166 }
1168 1167
1169 tmperr = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno, &bh, 1168 tmperr = ocfs2_read_block(inode, p_blkno, &bh, readflags);
1170 readflags, inode);
1171 if (tmperr < 0) 1169 if (tmperr < 0)
1172 goto fail; 1170 goto fail;
1173 1171
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 10c51b562be8..9854fb7315b6 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -1134,7 +1134,7 @@ static int ocfs2_read_journal_inode(struct ocfs2_super *osb,
1134 } 1134 }
1135 SET_INODE_JOURNAL(inode); 1135 SET_INODE_JOURNAL(inode);
1136 1136
1137 status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, bh, 0, inode); 1137 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, bh, 0);
1138 if (status < 0) { 1138 if (status < 0) {
1139 mlog_errno(status); 1139 mlog_errno(status);
1140 goto bail; 1140 goto bail;
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index 1c4f0645fb37..b77b67bb2776 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -248,8 +248,8 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
248 goto bail; 248 goto bail;
249 } 249 }
250 250
251 status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, 251 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
252 &alloc_bh, 0, inode); 252 &alloc_bh, 0);
253 if (status < 0) { 253 if (status < 0) {
254 mlog_errno(status); 254 mlog_errno(status);
255 goto bail; 255 goto bail;
@@ -459,8 +459,8 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
459 459
460 mutex_lock(&inode->i_mutex); 460 mutex_lock(&inode->i_mutex);
461 461
462 status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, 462 status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
463 &alloc_bh, 0, inode); 463 &alloc_bh, 0);
464 if (status < 0) { 464 if (status < 0) {
465 mlog_errno(status); 465 mlog_errno(status);
466 goto bail; 466 goto bail;
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 7d0dd5c95eb3..e5fc9345dd36 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -1752,10 +1752,9 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb,
1752 1752
1753 mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino); 1753 mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
1754 1754
1755 status = ocfs2_read_block(osb, 1755 status = ocfs2_read_block(orphan_dir_inode,
1756 OCFS2_I(orphan_dir_inode)->ip_blkno, 1756 OCFS2_I(orphan_dir_inode)->ip_blkno,
1757 &orphan_dir_bh, OCFS2_BH_CACHED, 1757 &orphan_dir_bh, OCFS2_BH_CACHED);
1758 orphan_dir_inode);
1759 if (status < 0) { 1758 if (status < 0) {
1760 mlog_errno(status); 1759 mlog_errno(status);
1761 goto leave; 1760 goto leave;
diff --git a/fs/ocfs2/resize.c b/fs/ocfs2/resize.c
index 472d854796c2..92dcd9350560 100644
--- a/fs/ocfs2/resize.c
+++ b/fs/ocfs2/resize.c
@@ -332,8 +332,8 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters)
332 lgd_blkno = ocfs2_which_cluster_group(main_bm_inode, 332 lgd_blkno = ocfs2_which_cluster_group(main_bm_inode,
333 first_new_cluster - 1); 333 first_new_cluster - 1);
334 334
335 ret = ocfs2_read_block(osb, lgd_blkno, &group_bh, OCFS2_BH_CACHED, 335 ret = ocfs2_read_block(main_bm_inode, lgd_blkno, &group_bh,
336 main_bm_inode); 336 OCFS2_BH_CACHED);
337 if (ret < 0) { 337 if (ret < 0) {
338 mlog_errno(ret); 338 mlog_errno(ret);
339 goto out_unlock; 339 goto out_unlock;
diff --git a/fs/ocfs2/slot_map.c b/fs/ocfs2/slot_map.c
index bb5ff8939bf1..82d986bff7fe 100644
--- a/fs/ocfs2/slot_map.c
+++ b/fs/ocfs2/slot_map.c
@@ -150,8 +150,7 @@ int ocfs2_refresh_slot_info(struct ocfs2_super *osb)
150 * be !NULL. Thus, ocfs2_read_blocks() will ignore blocknr. If 150 * be !NULL. Thus, ocfs2_read_blocks() will ignore blocknr. If
151 * this is not true, the read of -1 (UINT64_MAX) will fail. 151 * this is not true, the read of -1 (UINT64_MAX) will fail.
152 */ 152 */
153 ret = ocfs2_read_blocks(osb, -1, si->si_blocks, si->si_bh, 0, 153 ret = ocfs2_read_blocks(si->si_inode, -1, si->si_blocks, si->si_bh, 0);
154 si->si_inode);
155 if (ret == 0) { 154 if (ret == 0) {
156 spin_lock(&osb->osb_lock); 155 spin_lock(&osb->osb_lock);
157 ocfs2_update_slot_info(si); 156 ocfs2_update_slot_info(si);
@@ -404,7 +403,7 @@ static int ocfs2_map_slot_buffers(struct ocfs2_super *osb,
404 (unsigned long long)blkno); 403 (unsigned long long)blkno);
405 404
406 bh = NULL; /* Acquire a fresh bh */ 405 bh = NULL; /* Acquire a fresh bh */
407 status = ocfs2_read_block(osb, blkno, &bh, 0, si->si_inode); 406 status = ocfs2_read_block(si->si_inode, blkno, &bh, 0);
408 if (status < 0) { 407 if (status < 0) {
409 mlog_errno(status); 408 mlog_errno(status);
410 goto bail; 409 goto bail;
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 08d8844a3c2d..f0056b7d4353 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -1172,8 +1172,8 @@ 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(OCFS2_SB(alloc_inode->i_sb), gd_blkno, 1175 ret = ocfs2_read_block(alloc_inode, gd_blkno,
1176 &group_bh, OCFS2_BH_CACHED, alloc_inode); 1176 &group_bh, OCFS2_BH_CACHED);
1177 if (ret < 0) { 1177 if (ret < 0) {
1178 mlog_errno(ret); 1178 mlog_errno(ret);
1179 return ret; 1179 return ret;
@@ -1242,9 +1242,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1242 bits_wanted, chain, 1242 bits_wanted, chain,
1243 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno); 1243 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno);
1244 1244
1245 status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), 1245 status = ocfs2_read_block(alloc_inode,
1246 le64_to_cpu(cl->cl_recs[chain].c_blkno), 1246 le64_to_cpu(cl->cl_recs[chain].c_blkno),
1247 &group_bh, OCFS2_BH_CACHED, alloc_inode); 1247 &group_bh, OCFS2_BH_CACHED);
1248 if (status < 0) { 1248 if (status < 0) {
1249 mlog_errno(status); 1249 mlog_errno(status);
1250 goto bail; 1250 goto bail;
@@ -1272,9 +1272,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1272 next_group = le64_to_cpu(bg->bg_next_group); 1272 next_group = le64_to_cpu(bg->bg_next_group);
1273 prev_group_bh = group_bh; 1273 prev_group_bh = group_bh;
1274 group_bh = NULL; 1274 group_bh = NULL;
1275 status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), 1275 status = ocfs2_read_block(alloc_inode,
1276 next_group, &group_bh, 1276 next_group, &group_bh,
1277 OCFS2_BH_CACHED, alloc_inode); 1277 OCFS2_BH_CACHED);
1278 if (status < 0) { 1278 if (status < 0) {
1279 mlog_errno(status); 1279 mlog_errno(status);
1280 goto bail; 1280 goto bail;
@@ -1777,7 +1777,6 @@ int ocfs2_free_suballoc_bits(handle_t *handle,
1777{ 1777{
1778 int status = 0; 1778 int status = 0;
1779 u32 tmp_used; 1779 u32 tmp_used;
1780 struct ocfs2_super *osb = OCFS2_SB(alloc_inode->i_sb);
1781 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) alloc_bh->b_data; 1780 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) alloc_bh->b_data;
1782 struct ocfs2_chain_list *cl = &fe->id2.i_chain; 1781 struct ocfs2_chain_list *cl = &fe->id2.i_chain;
1783 struct buffer_head *group_bh = NULL; 1782 struct buffer_head *group_bh = NULL;
@@ -1796,8 +1795,8 @@ int ocfs2_free_suballoc_bits(handle_t *handle,
1796 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, 1795 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count,
1797 (unsigned long long)bg_blkno, start_bit); 1796 (unsigned long long)bg_blkno, start_bit);
1798 1797
1799 status = ocfs2_read_block(osb, bg_blkno, &group_bh, OCFS2_BH_CACHED, 1798 status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh,
1800 alloc_inode); 1799 OCFS2_BH_CACHED);
1801 if (status < 0) { 1800 if (status < 0) {
1802 mlog_errno(status); 1801 mlog_errno(status);
1803 goto bail; 1802 goto bail;
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index c6c94b55774f..8788dc26316d 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -84,11 +84,10 @@ static char *ocfs2_fast_symlink_getlink(struct inode *inode,
84 84
85 mlog_entry_void(); 85 mlog_entry_void();
86 86
87 status = ocfs2_read_block(OCFS2_SB(inode->i_sb), 87 status = ocfs2_read_block(inode,
88 OCFS2_I(inode)->ip_blkno, 88 OCFS2_I(inode)->ip_blkno,
89 bh, 89 bh,
90 OCFS2_BH_CACHED, 90 OCFS2_BH_CACHED);
91 inode);
92 if (status < 0) { 91 if (status < 0) {
93 mlog_errno(status); 92 mlog_errno(status);
94 link = ERR_PTR(status); 93 link = ERR_PTR(status);
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 8f522f2f84a5..63037bd7892f 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -537,9 +537,9 @@ static int ocfs2_xattr_block_list(struct inode *inode,
537 if (!di->i_xattr_loc) 537 if (!di->i_xattr_loc)
538 return ret; 538 return ret;
539 539
540 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 540 ret = ocfs2_read_block(inode,
541 le64_to_cpu(di->i_xattr_loc), 541 le64_to_cpu(di->i_xattr_loc),
542 &blk_bh, OCFS2_BH_CACHED, inode); 542 &blk_bh, OCFS2_BH_CACHED);
543 if (ret < 0) { 543 if (ret < 0) {
544 mlog_errno(ret); 544 mlog_errno(ret);
545 return ret; 545 return ret;
@@ -672,8 +672,8 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode,
672 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); 672 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
673 /* Copy ocfs2_xattr_value */ 673 /* Copy ocfs2_xattr_value */
674 for (i = 0; i < num_clusters * bpc; i++, blkno++) { 674 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
675 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, 675 ret = ocfs2_read_block(inode, blkno,
676 &bh, OCFS2_BH_CACHED, inode); 676 &bh, OCFS2_BH_CACHED);
677 if (ret) { 677 if (ret) {
678 mlog_errno(ret); 678 mlog_errno(ret);
679 goto out; 679 goto out;
@@ -764,9 +764,9 @@ static int ocfs2_xattr_block_get(struct inode *inode,
764 764
765 memset(&xs->bucket, 0, sizeof(xs->bucket)); 765 memset(&xs->bucket, 0, sizeof(xs->bucket));
766 766
767 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 767 ret = ocfs2_read_block(inode,
768 le64_to_cpu(di->i_xattr_loc), 768 le64_to_cpu(di->i_xattr_loc),
769 &blk_bh, OCFS2_BH_CACHED, inode); 769 &blk_bh, OCFS2_BH_CACHED);
770 if (ret < 0) { 770 if (ret < 0) {
771 mlog_errno(ret); 771 mlog_errno(ret);
772 return ret; 772 return ret;
@@ -922,8 +922,8 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode,
922 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); 922 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
923 923
924 for (i = 0; i < num_clusters * bpc; i++, blkno++) { 924 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
925 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, 925 ret = ocfs2_read_block(inode, blkno,
926 &bh, OCFS2_BH_CACHED, inode); 926 &bh, OCFS2_BH_CACHED);
927 if (ret) { 927 if (ret) {
928 mlog_errno(ret); 928 mlog_errno(ret);
929 goto out_commit; 929 goto out_commit;
@@ -1514,8 +1514,8 @@ static int ocfs2_xattr_free_block(struct inode *inode,
1514 u64 blk, bg_blkno; 1514 u64 blk, bg_blkno;
1515 u16 bit; 1515 u16 bit;
1516 1516
1517 ret = ocfs2_read_block(osb, block, &blk_bh, 1517 ret = ocfs2_read_block(inode, block, &blk_bh,
1518 OCFS2_BH_CACHED, inode); 1518 OCFS2_BH_CACHED);
1519 if (ret < 0) { 1519 if (ret < 0) {
1520 mlog_errno(ret); 1520 mlog_errno(ret);
1521 goto out; 1521 goto out;
@@ -1773,9 +1773,9 @@ static int ocfs2_xattr_block_find(struct inode *inode,
1773 if (!di->i_xattr_loc) 1773 if (!di->i_xattr_loc)
1774 return ret; 1774 return ret;
1775 1775
1776 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 1776 ret = ocfs2_read_block(inode,
1777 le64_to_cpu(di->i_xattr_loc), 1777 le64_to_cpu(di->i_xattr_loc),
1778 &blk_bh, OCFS2_BH_CACHED, inode); 1778 &blk_bh, OCFS2_BH_CACHED);
1779 if (ret < 0) { 1779 if (ret < 0) {
1780 mlog_errno(ret); 1780 mlog_errno(ret);
1781 return ret; 1781 return ret;
@@ -2216,9 +2216,9 @@ static int ocfs2_find_xe_in_bucket(struct inode *inode,
2216 break; 2216 break;
2217 } 2217 }
2218 2218
2219 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), 2219 ret = ocfs2_read_block(inode,
2220 header_bh->b_blocknr + block_off, 2220 header_bh->b_blocknr + block_off,
2221 &name_bh, OCFS2_BH_CACHED, inode); 2221 &name_bh, OCFS2_BH_CACHED);
2222 if (ret) { 2222 if (ret) {
2223 mlog_errno(ret); 2223 mlog_errno(ret);
2224 break; 2224 break;
@@ -2269,8 +2269,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
2269 u32 last_hash; 2269 u32 last_hash;
2270 u64 blkno; 2270 u64 blkno;
2271 2271
2272 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno, 2272 ret = ocfs2_read_block(inode, p_blkno, &bh, OCFS2_BH_CACHED);
2273 &bh, OCFS2_BH_CACHED, inode);
2274 if (ret) { 2273 if (ret) {
2275 mlog_errno(ret); 2274 mlog_errno(ret);
2276 goto out; 2275 goto out;
@@ -2286,8 +2285,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
2286 2285
2287 blkno = p_blkno + bucket * blk_per_bucket; 2286 blkno = p_blkno + bucket * blk_per_bucket;
2288 2287
2289 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, 2288 ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
2290 &bh, OCFS2_BH_CACHED, inode);
2291 if (ret) { 2289 if (ret) {
2292 mlog_errno(ret); 2290 mlog_errno(ret);
2293 goto out; 2291 goto out;
@@ -2359,10 +2357,9 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
2359 * If we have found the xattr enty, read all the blocks in 2357 * If we have found the xattr enty, read all the blocks in
2360 * this bucket. 2358 * this bucket.
2361 */ 2359 */
2362 ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), 2360 ret = ocfs2_read_blocks(inode, xs->bucket.bhs[0]->b_blocknr + 1,
2363 xs->bucket.bhs[0]->b_blocknr + 1,
2364 blk_per_bucket - 1, &xs->bucket.bhs[1], 2361 blk_per_bucket - 1, &xs->bucket.bhs[1],
2365 OCFS2_BH_CACHED, inode); 2362 OCFS2_BH_CACHED);
2366 if (ret) { 2363 if (ret) {
2367 mlog_errno(ret); 2364 mlog_errno(ret);
2368 goto out; 2365 goto out;
@@ -2438,9 +2435,8 @@ static int ocfs2_iterate_xattr_buckets(struct inode *inode,
2438 clusters, blkno); 2435 clusters, blkno);
2439 2436
2440 for (i = 0; i < num_buckets; i++, blkno += blk_per_bucket) { 2437 for (i = 0; i < num_buckets; i++, blkno += blk_per_bucket) {
2441 ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), 2438 ret = ocfs2_read_blocks(inode, blkno, blk_per_bucket,
2442 blkno, blk_per_bucket, 2439 bucket.bhs, OCFS2_BH_CACHED);
2443 bucket.bhs, OCFS2_BH_CACHED, inode);
2444 if (ret) { 2440 if (ret) {
2445 mlog_errno(ret); 2441 mlog_errno(ret);
2446 goto out; 2442 goto out;
@@ -2705,10 +2701,10 @@ static int ocfs2_xattr_update_xattr_search(struct inode *inode,
2705 2701
2706 if (!xs->not_found) { 2702 if (!xs->not_found) {
2707 if (OCFS2_XATTR_BUCKET_SIZE != blocksize) { 2703 if (OCFS2_XATTR_BUCKET_SIZE != blocksize) {
2708 ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), 2704 ret = ocfs2_read_blocks(inode,
2709 xs->bucket.bhs[0]->b_blocknr + 1, 2705 xs->bucket.bhs[0]->b_blocknr + 1,
2710 blk_per_bucket - 1, &xs->bucket.bhs[1], 2706 blk_per_bucket - 1, &xs->bucket.bhs[1],
2711 OCFS2_BH_CACHED, inode); 2707 OCFS2_BH_CACHED);
2712 if (ret) { 2708 if (ret) {
2713 mlog_errno(ret); 2709 mlog_errno(ret);
2714 return ret; 2710 return ret;
@@ -2913,8 +2909,8 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode,
2913 if (!bhs) 2909 if (!bhs)
2914 return -ENOMEM; 2910 return -ENOMEM;
2915 2911
2916 ret = ocfs2_read_blocks(osb, blkno, blk_per_bucket, bhs, 2912 ret = ocfs2_read_blocks(inode, blkno, blk_per_bucket, bhs,
2917 OCFS2_BH_CACHED, inode); 2913 OCFS2_BH_CACHED);
2918 if (ret) 2914 if (ret)
2919 goto out; 2915 goto out;
2920 2916
@@ -3114,8 +3110,8 @@ static int ocfs2_mv_xattr_bucket_cross_cluster(struct inode *inode,
3114 goto out; 3110 goto out;
3115 } 3111 }
3116 3112
3117 ret = ocfs2_read_block(osb, prev_blkno, 3113 ret = ocfs2_read_block(inode, prev_blkno,
3118 &old_bh, OCFS2_BH_CACHED, inode); 3114 &old_bh, OCFS2_BH_CACHED);
3119 if (ret < 0) { 3115 if (ret < 0) {
3120 mlog_errno(ret); 3116 mlog_errno(ret);
3121 brelse(new_bh); 3117 brelse(new_bh);
@@ -3168,9 +3164,9 @@ static int ocfs2_read_xattr_bucket(struct inode *inode,
3168 u16 i, blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); 3164 u16 i, blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
3169 3165
3170 if (!new) 3166 if (!new)
3171 return ocfs2_read_blocks(OCFS2_SB(inode->i_sb), blkno, 3167 return ocfs2_read_blocks(inode, blkno,
3172 blk_per_bucket, bhs, 3168 blk_per_bucket, bhs,
3173 OCFS2_BH_CACHED, inode); 3169 OCFS2_BH_CACHED);
3174 3170
3175 for (i = 0; i < blk_per_bucket; i++) { 3171 for (i = 0; i < blk_per_bucket; i++) {
3176 bhs[i] = sb_getblk(inode->i_sb, blkno + i); 3172 bhs[i] = sb_getblk(inode->i_sb, blkno + i);
@@ -3485,7 +3481,7 @@ static int ocfs2_cp_xattr_cluster(struct inode *inode,
3485 ocfs2_journal_dirty(handle, first_bh); 3481 ocfs2_journal_dirty(handle, first_bh);
3486 3482
3487 /* update the new bucket header. */ 3483 /* update the new bucket header. */
3488 ret = ocfs2_read_block(osb, to_blk_start, &bh, OCFS2_BH_CACHED, inode); 3484 ret = ocfs2_read_block(inode, to_blk_start, &bh, OCFS2_BH_CACHED);
3489 if (ret < 0) { 3485 if (ret < 0) {
3490 mlog_errno(ret); 3486 mlog_errno(ret);
3491 goto out; 3487 goto out;
@@ -3872,8 +3868,8 @@ static int ocfs2_add_new_xattr_bucket(struct inode *inode,
3872 goto out; 3868 goto out;
3873 } 3869 }
3874 3870
3875 ret = ocfs2_read_block(osb, p_blkno, 3871 ret = ocfs2_read_block(inode, p_blkno,
3876 &first_bh, OCFS2_BH_CACHED, inode); 3872 &first_bh, OCFS2_BH_CACHED);
3877 if (ret) { 3873 if (ret) {
3878 mlog_errno(ret); 3874 mlog_errno(ret);
3879 goto out; 3875 goto out;
@@ -4115,10 +4111,10 @@ static int ocfs2_xattr_set_entry_in_bucket(struct inode *inode,
4115 (unsigned long long)xs->bucket.bhs[0]->b_blocknr); 4111 (unsigned long long)xs->bucket.bhs[0]->b_blocknr);
4116 4112
4117 if (!xs->bucket.bhs[1]) { 4113 if (!xs->bucket.bhs[1]) {
4118 ret = ocfs2_read_blocks(osb, 4114 ret = ocfs2_read_blocks(inode,
4119 xs->bucket.bhs[0]->b_blocknr + 1, 4115 xs->bucket.bhs[0]->b_blocknr + 1,
4120 blk_per_bucket - 1, &xs->bucket.bhs[1], 4116 blk_per_bucket - 1, &xs->bucket.bhs[1],
4121 OCFS2_BH_CACHED, inode); 4117 OCFS2_BH_CACHED);
4122 if (ret) { 4118 if (ret) {
4123 mlog_errno(ret); 4119 mlog_errno(ret);
4124 goto out; 4120 goto out;
@@ -4224,8 +4220,8 @@ static int ocfs2_xattr_bucket_value_truncate(struct inode *inode,
4224 BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize); 4220 BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize);
4225 value_blk += header_bh->b_blocknr; 4221 value_blk += header_bh->b_blocknr;
4226 4222
4227 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), value_blk, 4223 ret = ocfs2_read_block(inode, value_blk,
4228 &value_bh, OCFS2_BH_CACHED, inode); 4224 &value_bh, OCFS2_BH_CACHED);
4229 if (ret) { 4225 if (ret) {
4230 mlog_errno(ret); 4226 mlog_errno(ret);
4231 goto out; 4227 goto out;