]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.suse/ocfs2-Require-an-inode-for-ocfs2_read_block-s.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.suse / ocfs2-Require-an-inode-for-ocfs2_read_block-s.patch
CommitLineData
2cb7cef9
BS
1From: Joel Becker <joel.becker@oracle.com>
2Subject: ocfs2: Require an inode for ocfs2_read_block(s)().
3Patch-mainline: 2.6.28
4
5Now that synchronous readers are using ocfs2_read_blocks_sync(), all
6callers of ocfs2_read_blocks() are passing an inode. Use it
7unconditionally. Since it's there, we don't need to pass the
8ocfs2_super either.
9
10Signed-off-by: Joel Becker <joel.becker@oracle.com>
11Signed-off-by: Mark Fasheh <mfasheh@suse.com>
12---
13 fs/ocfs2/alloc.c | 30 ++++++++----------
14 fs/ocfs2/aops.c | 10 ++----
15 fs/ocfs2/buffer_head_io.c | 35 +++++++--------------
16 fs/ocfs2/buffer_head_io.h | 18 ++++-------
17 fs/ocfs2/dir.c | 12 ++++----
18 fs/ocfs2/dlmglue.c | 9 ++---
19 fs/ocfs2/extent_map.c | 12 ++++----
20 fs/ocfs2/file.c | 12 +++----
21 fs/ocfs2/inode.c | 6 +--
22 fs/ocfs2/journal.c | 2 +-
23 fs/ocfs2/localalloc.c | 8 ++--
24 fs/ocfs2/namei.c | 5 +--
25 fs/ocfs2/resize.c | 4 +-
26 fs/ocfs2/slot_map.c | 5 +--
27 fs/ocfs2/suballoc.c | 17 +++++-----
28 fs/ocfs2/symlink.c | 5 +--
29 fs/ocfs2/xattr.c | 74 +++++++++++++++++++++-----------------------
30 17 files changed, 116 insertions(+), 148 deletions(-)
31
32Index: linux-2.6.27/fs/ocfs2/alloc.c
33===================================================================
34--- linux-2.6.27.orig/fs/ocfs2/alloc.c
35+++ linux-2.6.27/fs/ocfs2/alloc.c
36@@ -705,8 +705,8 @@ int ocfs2_num_free_extents(struct ocfs2_
37 last_eb_blk = ocfs2_et_get_last_eb_blk(et);
38
39 if (last_eb_blk) {
40- retval = ocfs2_read_block(osb, last_eb_blk,
41- &eb_bh, OCFS2_BH_CACHED, inode);
42+ retval = ocfs2_read_block(inode, last_eb_blk,
43+ &eb_bh, OCFS2_BH_CACHED);
44 if (retval < 0) {
45 mlog_errno(retval);
46 goto bail;
47@@ -1176,8 +1176,7 @@ static int ocfs2_find_branch_target(stru
48 brelse(bh);
49 bh = NULL;
50
51- status = ocfs2_read_block(osb, blkno, &bh, OCFS2_BH_CACHED,
52- inode);
53+ status = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
54 if (status < 0) {
55 mlog_errno(status);
56 goto bail;
57@@ -1550,8 +1549,7 @@ static int __ocfs2_find_path(struct inod
58
59 brelse(bh);
60 bh = NULL;
61- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno,
62- &bh, OCFS2_BH_CACHED, inode);
63+ ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
64 if (ret) {
65 mlog_errno(ret);
66 goto out;
67@@ -4305,9 +4303,9 @@ static int ocfs2_figure_insert_type(stru
68 * ocfs2_figure_insert_type() and ocfs2_add_branch()
69 * may want it later.
70 */
71- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
72+ ret = ocfs2_read_block(inode,
73 ocfs2_et_get_last_eb_blk(et), &bh,
74- OCFS2_BH_CACHED, inode);
75+ OCFS2_BH_CACHED);
76 if (ret) {
77 mlog_exit(ret);
78 goto out;
79@@ -4773,9 +4771,9 @@ static int __ocfs2_mark_extent_written(s
80 if (path->p_tree_depth) {
81 struct ocfs2_extent_block *eb;
82
83- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
84+ ret = ocfs2_read_block(inode,
85 ocfs2_et_get_last_eb_blk(et),
86- &last_eb_bh, OCFS2_BH_CACHED, inode);
87+ &last_eb_bh, OCFS2_BH_CACHED);
88 if (ret) {
89 mlog_exit(ret);
90 goto out;
91@@ -4932,9 +4930,9 @@ static int ocfs2_split_tree(struct inode
92
93 depth = path->p_tree_depth;
94 if (depth > 0) {
95- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
96+ ret = ocfs2_read_block(inode,
97 ocfs2_et_get_last_eb_blk(et),
98- &last_eb_bh, OCFS2_BH_CACHED, inode);
99+ &last_eb_bh, OCFS2_BH_CACHED);
100 if (ret < 0) {
101 mlog_errno(ret);
102 goto out;
103@@ -5601,8 +5599,8 @@ static int ocfs2_get_truncate_log_info(s
104 goto bail;
105 }
106
107- status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh,
108- OCFS2_BH_CACHED, inode);
109+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
110+ OCFS2_BH_CACHED);
111 if (status < 0) {
112 iput(inode);
113 mlog_errno(status);
114@@ -7000,8 +6998,8 @@ int ocfs2_prepare_truncate(struct ocfs2_
115 ocfs2_init_dealloc_ctxt(&(*tc)->tc_dealloc);
116
117 if (fe->id2.i_list.l_tree_depth) {
118- status = ocfs2_read_block(osb, le64_to_cpu(fe->i_last_eb_blk),
119- &last_eb_bh, OCFS2_BH_CACHED, inode);
120+ status = ocfs2_read_block(inode, le64_to_cpu(fe->i_last_eb_blk),
121+ &last_eb_bh, OCFS2_BH_CACHED);
122 if (status < 0) {
123 mlog_errno(status);
124 goto bail;
125Index: linux-2.6.27/fs/ocfs2/aops.c
126===================================================================
127--- linux-2.6.27.orig/fs/ocfs2/aops.c
128+++ linux-2.6.27/fs/ocfs2/aops.c
129@@ -68,9 +68,8 @@ static int ocfs2_symlink_get_block(struc
130 goto bail;
131 }
132
133- status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
134- OCFS2_I(inode)->ip_blkno,
135- &bh, OCFS2_BH_CACHED, inode);
136+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
137+ &bh, OCFS2_BH_CACHED);
138 if (status < 0) {
139 mlog_errno(status);
140 goto bail;
141@@ -260,13 +259,12 @@ static int ocfs2_readpage_inline(struct
142 {
143 int ret;
144 struct buffer_head *di_bh = NULL;
145- struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
146
147 BUG_ON(!PageLocked(page));
148 BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
149
150- ret = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &di_bh,
151- OCFS2_BH_CACHED, inode);
152+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh,
153+ OCFS2_BH_CACHED);
154 if (ret) {
155 mlog_errno(ret);
156 goto out;
157Index: linux-2.6.27/fs/ocfs2/buffer_head_io.c
158===================================================================
159--- linux-2.6.27.orig/fs/ocfs2/buffer_head_io.c
160+++ linux-2.6.27/fs/ocfs2/buffer_head_io.c
161@@ -170,22 +170,20 @@ bail:
162 return status;
163 }
164
165-int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr,
166- struct buffer_head *bhs[], int flags,
167- struct inode *inode)
168+int ocfs2_read_blocks(struct inode *inode, u64 block, int nr,
169+ struct buffer_head *bhs[], int flags)
170 {
171 int status = 0;
172- struct super_block *sb;
173 int i, ignore_cache = 0;
174 struct buffer_head *bh;
175
176- mlog_entry("(block=(%llu), nr=(%d), flags=%d, inode=%p)\n",
177- (unsigned long long)block, nr, flags, inode);
178+ mlog_entry("(inode=%p, block=(%llu), nr=(%d), flags=%d)\n",
179+ inode, (unsigned long long)block, nr, flags);
180
181- BUG_ON((flags & OCFS2_BH_READAHEAD) &&
182- (!inode || !(flags & OCFS2_BH_CACHED)));
183+ BUG_ON(!inode);
184+ BUG_ON((flags & OCFS2_BH_READAHEAD) && !(flags & OCFS2_BH_CACHED));
185
186- if (osb == NULL || osb->sb == NULL || bhs == NULL) {
187+ if (bhs == NULL) {
188 status = -EINVAL;
189 mlog_errno(status);
190 goto bail;
191@@ -204,19 +202,12 @@ int ocfs2_read_blocks(struct ocfs2_super
192 goto bail;
193 }
194
195- sb = osb->sb;
196-
197- if (flags & OCFS2_BH_CACHED && !inode)
198- flags &= ~OCFS2_BH_CACHED;
199-
200- if (inode)
201- mutex_lock(&OCFS2_I(inode)->ip_io_mutex);
202+ mutex_lock(&OCFS2_I(inode)->ip_io_mutex);
203 for (i = 0 ; i < nr ; i++) {
204 if (bhs[i] == NULL) {
205- bhs[i] = sb_getblk(sb, block++);
206+ bhs[i] = sb_getblk(inode->i_sb, block++);
207 if (bhs[i] == NULL) {
208- if (inode)
209- mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
210+ mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
211 status = -EIO;
212 mlog_errno(status);
213 goto bail;
214@@ -347,11 +338,9 @@ int ocfs2_read_blocks(struct ocfs2_super
215 /* Always set the buffer in the cache, even if it was
216 * a forced read, or read-ahead which hasn't yet
217 * completed. */
218- if (inode)
219- ocfs2_set_buffer_uptodate(inode, bh);
220+ ocfs2_set_buffer_uptodate(inode, bh);
221 }
222- if (inode)
223- mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
224+ mutex_unlock(&OCFS2_I(inode)->ip_io_mutex);
225
226 mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s, flags=0x%x\n",
227 (unsigned long long)block, nr,
228Index: linux-2.6.27/fs/ocfs2/buffer_head_io.h
229===================================================================
230--- linux-2.6.27.orig/fs/ocfs2/buffer_head_io.h
231+++ linux-2.6.27/fs/ocfs2/buffer_head_io.h
232@@ -31,21 +31,19 @@
233 void ocfs2_end_buffer_io_sync(struct buffer_head *bh,
234 int uptodate);
235
236-static inline int ocfs2_read_block(struct ocfs2_super *osb,
237+static inline int ocfs2_read_block(struct inode *inode,
238 u64 off,
239 struct buffer_head **bh,
240- int flags,
241- struct inode *inode);
242+ int flags);
243
244 int ocfs2_write_block(struct ocfs2_super *osb,
245 struct buffer_head *bh,
246 struct inode *inode);
247-int ocfs2_read_blocks(struct ocfs2_super *osb,
248+int ocfs2_read_blocks(struct inode *inode,
249 u64 block,
250 int nr,
251 struct buffer_head *bhs[],
252- int flags,
253- struct inode *inode);
254+ int flags);
255 int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
256 unsigned int nr, struct buffer_head *bhs[]);
257
258@@ -55,9 +53,8 @@ int ocfs2_write_super_or_backup(struct o
259 #define OCFS2_BH_CACHED 1
260 #define OCFS2_BH_READAHEAD 8
261
262-static inline int ocfs2_read_block(struct ocfs2_super * osb, u64 off,
263- struct buffer_head **bh, int flags,
264- struct inode *inode)
265+static inline int ocfs2_read_block(struct inode *inode, u64 off,
266+ struct buffer_head **bh, int flags)
267 {
268 int status = 0;
269
270@@ -67,8 +64,7 @@ static inline int ocfs2_read_block(struc
271 goto bail;
272 }
273
274- status = ocfs2_read_blocks(osb, off, 1, bh,
275- flags, inode);
276+ status = ocfs2_read_blocks(inode, off, 1, bh, flags);
277
278 bail:
279 return status;
280Index: linux-2.6.27/fs/ocfs2/dir.c
281===================================================================
282--- linux-2.6.27.orig/fs/ocfs2/dir.c
283+++ linux-2.6.27/fs/ocfs2/dir.c
284@@ -188,8 +188,8 @@ static struct buffer_head *ocfs2_find_en
285 struct ocfs2_dinode *di;
286 struct ocfs2_inline_data *data;
287
288- ret = ocfs2_read_block(OCFS2_SB(dir->i_sb), OCFS2_I(dir)->ip_blkno,
289- &di_bh, OCFS2_BH_CACHED, dir);
290+ ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno, &di_bh,
291+ OCFS2_BH_CACHED);
292 if (ret) {
293 mlog_errno(ret);
294 goto out;
295@@ -417,8 +417,8 @@ static inline int ocfs2_delete_entry_id(
296 struct ocfs2_dinode *di;
297 struct ocfs2_inline_data *data;
298
299- ret = ocfs2_read_block(OCFS2_SB(dir->i_sb), OCFS2_I(dir)->ip_blkno,
300- &di_bh, OCFS2_BH_CACHED, dir);
301+ ret = ocfs2_read_block(dir, OCFS2_I(dir)->ip_blkno,
302+ &di_bh, OCFS2_BH_CACHED);
303 if (ret) {
304 mlog_errno(ret);
305 goto out;
306@@ -596,8 +596,8 @@ static int ocfs2_dir_foreach_blk_id(stru
307 struct ocfs2_inline_data *data;
308 struct ocfs2_dir_entry *de;
309
310- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), OCFS2_I(inode)->ip_blkno,
311- &di_bh, OCFS2_BH_CACHED, inode);
312+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
313+ &di_bh, OCFS2_BH_CACHED);
314 if (ret) {
315 mlog(ML_ERROR, "Unable to read inode block for dir %llu\n",
316 (unsigned long long)OCFS2_I(inode)->ip_blkno);
317Index: linux-2.6.27/fs/ocfs2/dlmglue.c
318===================================================================
319--- linux-2.6.27.orig/fs/ocfs2/dlmglue.c
320+++ linux-2.6.27/fs/ocfs2/dlmglue.c
321@@ -2024,8 +2024,8 @@ static int ocfs2_inode_lock_update(struc
322 } else {
323 /* Boo, we have to go to disk. */
324 /* read bh, cast, ocfs2_refresh_inode */
325- status = ocfs2_read_block(OCFS2_SB(inode->i_sb), oi->ip_blkno,
326- bh, OCFS2_BH_CACHED, inode);
327+ status = ocfs2_read_block(inode, oi->ip_blkno,
328+ bh, OCFS2_BH_CACHED);
329 if (status < 0) {
330 mlog_errno(status);
331 goto bail_refresh;
332@@ -2086,11 +2086,10 @@ static int ocfs2_assign_bh(struct inode
333 return 0;
334 }
335
336- status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
337+ status = ocfs2_read_block(inode,
338 OCFS2_I(inode)->ip_blkno,
339 ret_bh,
340- OCFS2_BH_CACHED,
341- inode);
342+ OCFS2_BH_CACHED);
343 if (status < 0)
344 mlog_errno(status);
345
346Index: linux-2.6.27/fs/ocfs2/extent_map.c
347===================================================================
348--- linux-2.6.27.orig/fs/ocfs2/extent_map.c
349+++ linux-2.6.27/fs/ocfs2/extent_map.c
350@@ -335,9 +335,9 @@ static int ocfs2_figure_hole_clusters(st
351 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL)
352 goto no_more_extents;
353
354- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
355+ ret = ocfs2_read_block(inode,
356 le64_to_cpu(eb->h_next_leaf_blk),
357- &next_eb_bh, OCFS2_BH_CACHED, inode);
358+ &next_eb_bh, OCFS2_BH_CACHED);
359 if (ret) {
360 mlog_errno(ret);
361 goto out;
362@@ -458,8 +458,8 @@ int ocfs2_get_clusters(struct inode *ino
363 if (ret == 0)
364 goto out;
365
366- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), OCFS2_I(inode)->ip_blkno,
367- &di_bh, OCFS2_BH_CACHED, inode);
368+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
369+ &di_bh, OCFS2_BH_CACHED);
370 if (ret) {
371 mlog_errno(ret);
372 goto out;
373Index: linux-2.6.27/fs/ocfs2/file.c
374===================================================================
375--- linux-2.6.27.orig/fs/ocfs2/file.c
376+++ linux-2.6.27/fs/ocfs2/file.c
377@@ -545,8 +545,8 @@ static int __ocfs2_extend_allocation(str
378 */
379 BUG_ON(mark_unwritten && !ocfs2_sparse_alloc(osb));
380
381- status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh,
382- OCFS2_BH_CACHED, inode);
383+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh,
384+ OCFS2_BH_CACHED);
385 if (status < 0) {
386 mlog_errno(status);
387 goto leave;
388@@ -1132,8 +1132,7 @@ static int ocfs2_write_remove_suid(struc
389 struct buffer_head *bh = NULL;
390 struct ocfs2_inode_info *oi = OCFS2_I(inode);
391
392- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
393- oi->ip_blkno, &bh, OCFS2_BH_CACHED, inode);
394+ ret = ocfs2_read_block(inode, oi->ip_blkno, &bh, OCFS2_BH_CACHED);
395 if (ret < 0) {
396 mlog_errno(ret);
397 goto out;
398@@ -1159,9 +1158,8 @@ static int ocfs2_allocate_unwritten_exte
399 struct buffer_head *di_bh = NULL;
400
401 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
402- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
403- OCFS2_I(inode)->ip_blkno, &di_bh,
404- OCFS2_BH_CACHED, inode);
405+ ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
406+ &di_bh, OCFS2_BH_CACHED);
407 if (ret) {
408 mlog_errno(ret);
409 goto out;
410Index: linux-2.6.27/fs/ocfs2/inode.c
411===================================================================
412--- linux-2.6.27.orig/fs/ocfs2/inode.c
413+++ linux-2.6.27/fs/ocfs2/inode.c
414@@ -461,8 +461,7 @@ static int ocfs2_read_locked_inode(struc
415 }
416
417 if (can_lock)
418- status = ocfs2_read_block(osb, args->fi_blkno, &bh, 0,
419- inode);
420+ status = ocfs2_read_block(inode, args->fi_blkno, &bh, 0);
421 else
422 status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
423 if (status < 0) {
424@@ -1166,8 +1165,7 @@ struct buffer_head *ocfs2_bread(struct i
425 goto fail;
426 }
427
428- tmperr = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno, &bh,
429- readflags, inode);
430+ tmperr = ocfs2_read_block(inode, p_blkno, &bh, readflags);
431 if (tmperr < 0)
432 goto fail;
433
434Index: linux-2.6.27/fs/ocfs2/journal.c
435===================================================================
436--- linux-2.6.27.orig/fs/ocfs2/journal.c
437+++ linux-2.6.27/fs/ocfs2/journal.c
438@@ -1134,7 +1134,7 @@ static int ocfs2_read_journal_inode(stru
439 }
440 SET_INODE_JOURNAL(inode);
441
442- status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, bh, 0, inode);
443+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, bh, 0);
444 if (status < 0) {
445 mlog_errno(status);
446 goto bail;
447Index: linux-2.6.27/fs/ocfs2/localalloc.c
448===================================================================
449--- linux-2.6.27.orig/fs/ocfs2/localalloc.c
450+++ linux-2.6.27/fs/ocfs2/localalloc.c
451@@ -248,8 +248,8 @@ int ocfs2_load_local_alloc(struct ocfs2_
452 goto bail;
453 }
454
455- status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno,
456- &alloc_bh, 0, inode);
457+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
458+ &alloc_bh, 0);
459 if (status < 0) {
460 mlog_errno(status);
461 goto bail;
462@@ -459,8 +459,8 @@ int ocfs2_begin_local_alloc_recovery(str
463
464 mutex_lock(&inode->i_mutex);
465
466- status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno,
467- &alloc_bh, 0, inode);
468+ status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno,
469+ &alloc_bh, 0);
470 if (status < 0) {
471 mlog_errno(status);
472 goto bail;
473Index: linux-2.6.27/fs/ocfs2/namei.c
474===================================================================
475--- linux-2.6.27.orig/fs/ocfs2/namei.c
476+++ linux-2.6.27/fs/ocfs2/namei.c
477@@ -1752,10 +1752,9 @@ static int ocfs2_orphan_add(struct ocfs2
478
479 mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
480
481- status = ocfs2_read_block(osb,
482+ status = ocfs2_read_block(orphan_dir_inode,
483 OCFS2_I(orphan_dir_inode)->ip_blkno,
484- &orphan_dir_bh, OCFS2_BH_CACHED,
485- orphan_dir_inode);
486+ &orphan_dir_bh, OCFS2_BH_CACHED);
487 if (status < 0) {
488 mlog_errno(status);
489 goto leave;
490Index: linux-2.6.27/fs/ocfs2/resize.c
491===================================================================
492--- linux-2.6.27.orig/fs/ocfs2/resize.c
493+++ linux-2.6.27/fs/ocfs2/resize.c
494@@ -332,8 +332,8 @@ int ocfs2_group_extend(struct inode * in
495 lgd_blkno = ocfs2_which_cluster_group(main_bm_inode,
496 first_new_cluster - 1);
497
498- ret = ocfs2_read_block(osb, lgd_blkno, &group_bh, OCFS2_BH_CACHED,
499- main_bm_inode);
500+ ret = ocfs2_read_block(main_bm_inode, lgd_blkno, &group_bh,
501+ OCFS2_BH_CACHED);
502 if (ret < 0) {
503 mlog_errno(ret);
504 goto out_unlock;
505Index: linux-2.6.27/fs/ocfs2/slot_map.c
506===================================================================
507--- linux-2.6.27.orig/fs/ocfs2/slot_map.c
508+++ linux-2.6.27/fs/ocfs2/slot_map.c
509@@ -150,8 +150,7 @@ int ocfs2_refresh_slot_info(struct ocfs2
510 * be !NULL. Thus, ocfs2_read_blocks() will ignore blocknr. If
511 * this is not true, the read of -1 (UINT64_MAX) will fail.
512 */
513- ret = ocfs2_read_blocks(osb, -1, si->si_blocks, si->si_bh, 0,
514- si->si_inode);
515+ ret = ocfs2_read_blocks(si->si_inode, -1, si->si_blocks, si->si_bh, 0);
516 if (ret == 0) {
517 spin_lock(&osb->osb_lock);
518 ocfs2_update_slot_info(si);
519@@ -404,7 +403,7 @@ static int ocfs2_map_slot_buffers(struct
520 (unsigned long long)blkno);
521
522 bh = NULL; /* Acquire a fresh bh */
523- status = ocfs2_read_block(osb, blkno, &bh, 0, si->si_inode);
524+ status = ocfs2_read_block(si->si_inode, blkno, &bh, 0);
525 if (status < 0) {
526 mlog_errno(status);
527 goto bail;
528Index: linux-2.6.27/fs/ocfs2/suballoc.c
529===================================================================
530--- linux-2.6.27.orig/fs/ocfs2/suballoc.c
531+++ linux-2.6.27/fs/ocfs2/suballoc.c
532@@ -1172,8 +1172,8 @@ static int ocfs2_search_one_group(struct
533 struct ocfs2_group_desc *gd;
534 struct inode *alloc_inode = ac->ac_inode;
535
536- ret = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), gd_blkno,
537- &group_bh, OCFS2_BH_CACHED, alloc_inode);
538+ ret = ocfs2_read_block(alloc_inode, gd_blkno,
539+ &group_bh, OCFS2_BH_CACHED);
540 if (ret < 0) {
541 mlog_errno(ret);
542 return ret;
543@@ -1242,9 +1242,9 @@ static int ocfs2_search_chain(struct ocf
544 bits_wanted, chain,
545 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno);
546
547- status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb),
548+ status = ocfs2_read_block(alloc_inode,
549 le64_to_cpu(cl->cl_recs[chain].c_blkno),
550- &group_bh, OCFS2_BH_CACHED, alloc_inode);
551+ &group_bh, OCFS2_BH_CACHED);
552 if (status < 0) {
553 mlog_errno(status);
554 goto bail;
555@@ -1272,9 +1272,9 @@ static int ocfs2_search_chain(struct ocf
556 next_group = le64_to_cpu(bg->bg_next_group);
557 prev_group_bh = group_bh;
558 group_bh = NULL;
559- status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb),
560+ status = ocfs2_read_block(alloc_inode,
561 next_group, &group_bh,
562- OCFS2_BH_CACHED, alloc_inode);
563+ OCFS2_BH_CACHED);
564 if (status < 0) {
565 mlog_errno(status);
566 goto bail;
567@@ -1777,7 +1777,6 @@ int ocfs2_free_suballoc_bits(handle_t *h
568 {
569 int status = 0;
570 u32 tmp_used;
571- struct ocfs2_super *osb = OCFS2_SB(alloc_inode->i_sb);
572 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) alloc_bh->b_data;
573 struct ocfs2_chain_list *cl = &fe->id2.i_chain;
574 struct buffer_head *group_bh = NULL;
575@@ -1796,8 +1795,8 @@ int ocfs2_free_suballoc_bits(handle_t *h
576 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count,
577 (unsigned long long)bg_blkno, start_bit);
578
579- status = ocfs2_read_block(osb, bg_blkno, &group_bh, OCFS2_BH_CACHED,
580- alloc_inode);
581+ status = ocfs2_read_block(alloc_inode, bg_blkno, &group_bh,
582+ OCFS2_BH_CACHED);
583 if (status < 0) {
584 mlog_errno(status);
585 goto bail;
586Index: linux-2.6.27/fs/ocfs2/symlink.c
587===================================================================
588--- linux-2.6.27.orig/fs/ocfs2/symlink.c
589+++ linux-2.6.27/fs/ocfs2/symlink.c
590@@ -84,11 +84,10 @@ static char *ocfs2_fast_symlink_getlink(
591
592 mlog_entry_void();
593
594- status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
595+ status = ocfs2_read_block(inode,
596 OCFS2_I(inode)->ip_blkno,
597 bh,
598- OCFS2_BH_CACHED,
599- inode);
600+ OCFS2_BH_CACHED);
601 if (status < 0) {
602 mlog_errno(status);
603 link = ERR_PTR(status);
604Index: linux-2.6.27/fs/ocfs2/xattr.c
605===================================================================
606--- linux-2.6.27.orig/fs/ocfs2/xattr.c
607+++ linux-2.6.27/fs/ocfs2/xattr.c
608@@ -553,9 +553,9 @@ static int ocfs2_xattr_block_list(struct
609 if (!di->i_xattr_loc)
610 return ret;
611
612- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
613+ ret = ocfs2_read_block(inode,
614 le64_to_cpu(di->i_xattr_loc),
615- &blk_bh, OCFS2_BH_CACHED, inode);
616+ &blk_bh, OCFS2_BH_CACHED);
617 if (ret < 0) {
618 mlog_errno(ret);
619 return ret;
620@@ -688,8 +688,8 @@ static int ocfs2_xattr_get_value_outside
621 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
622 /* Copy ocfs2_xattr_value */
623 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
624- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno,
625- &bh, OCFS2_BH_CACHED, inode);
626+ ret = ocfs2_read_block(inode, blkno,
627+ &bh, OCFS2_BH_CACHED);
628 if (ret) {
629 mlog_errno(ret);
630 goto out;
631@@ -780,9 +780,9 @@ static int ocfs2_xattr_block_get(struct
632
633 memset(&xs->bucket, 0, sizeof(xs->bucket));
634
635- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
636+ ret = ocfs2_read_block(inode,
637 le64_to_cpu(di->i_xattr_loc),
638- &blk_bh, OCFS2_BH_CACHED, inode);
639+ &blk_bh, OCFS2_BH_CACHED);
640 if (ret < 0) {
641 mlog_errno(ret);
642 return ret;
643@@ -938,8 +938,8 @@ static int __ocfs2_xattr_set_value_outsi
644 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
645
646 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
647- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno,
648- &bh, OCFS2_BH_CACHED, inode);
649+ ret = ocfs2_read_block(inode, blkno,
650+ &bh, OCFS2_BH_CACHED);
651 if (ret) {
652 mlog_errno(ret);
653 goto out_commit;
654@@ -1530,8 +1530,8 @@ static int ocfs2_xattr_free_block(struct
655 u64 blk, bg_blkno;
656 u16 bit;
657
658- ret = ocfs2_read_block(osb, block, &blk_bh,
659- OCFS2_BH_CACHED, inode);
660+ ret = ocfs2_read_block(inode, block, &blk_bh,
661+ OCFS2_BH_CACHED);
662 if (ret < 0) {
663 mlog_errno(ret);
664 goto out;
665@@ -1789,9 +1789,9 @@ static int ocfs2_xattr_block_find(struct
666 if (!di->i_xattr_loc)
667 return ret;
668
669- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
670+ ret = ocfs2_read_block(inode,
671 le64_to_cpu(di->i_xattr_loc),
672- &blk_bh, OCFS2_BH_CACHED, inode);
673+ &blk_bh, OCFS2_BH_CACHED);
674 if (ret < 0) {
675 mlog_errno(ret);
676 return ret;
677@@ -2232,9 +2232,9 @@ static int ocfs2_find_xe_in_bucket(struc
678 break;
679 }
680
681- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
682+ ret = ocfs2_read_block(inode,
683 header_bh->b_blocknr + block_off,
684- &name_bh, OCFS2_BH_CACHED, inode);
685+ &name_bh, OCFS2_BH_CACHED);
686 if (ret) {
687 mlog_errno(ret);
688 break;
689@@ -2285,8 +2285,7 @@ static int ocfs2_xattr_bucket_find(struc
690 u32 last_hash;
691 u64 blkno;
692
693- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno,
694- &bh, OCFS2_BH_CACHED, inode);
695+ ret = ocfs2_read_block(inode, p_blkno, &bh, OCFS2_BH_CACHED);
696 if (ret) {
697 mlog_errno(ret);
698 goto out;
699@@ -2302,8 +2301,7 @@ static int ocfs2_xattr_bucket_find(struc
700
701 blkno = p_blkno + bucket * blk_per_bucket;
702
703- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno,
704- &bh, OCFS2_BH_CACHED, inode);
705+ ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED);
706 if (ret) {
707 mlog_errno(ret);
708 goto out;
709@@ -2375,10 +2373,9 @@ static int ocfs2_xattr_bucket_find(struc
710 * If we have found the xattr enty, read all the blocks in
711 * this bucket.
712 */
713- ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb),
714- xs->bucket.bhs[0]->b_blocknr + 1,
715+ ret = ocfs2_read_blocks(inode, xs->bucket.bhs[0]->b_blocknr + 1,
716 blk_per_bucket - 1, &xs->bucket.bhs[1],
717- OCFS2_BH_CACHED, inode);
718+ OCFS2_BH_CACHED);
719 if (ret) {
720 mlog_errno(ret);
721 goto out;
722@@ -2454,9 +2451,8 @@ static int ocfs2_iterate_xattr_buckets(s
723 clusters, blkno);
724
725 for (i = 0; i < num_buckets; i++, blkno += blk_per_bucket) {
726- ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb),
727- blkno, blk_per_bucket,
728- bucket.bhs, OCFS2_BH_CACHED, inode);
729+ ret = ocfs2_read_blocks(inode, blkno, blk_per_bucket,
730+ bucket.bhs, OCFS2_BH_CACHED);
731 if (ret) {
732 mlog_errno(ret);
733 goto out;
734@@ -2721,10 +2717,10 @@ static int ocfs2_xattr_update_xattr_sear
735
736 if (!xs->not_found) {
737 if (OCFS2_XATTR_BUCKET_SIZE != blocksize) {
738- ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb),
739+ ret = ocfs2_read_blocks(inode,
740 xs->bucket.bhs[0]->b_blocknr + 1,
741 blk_per_bucket - 1, &xs->bucket.bhs[1],
742- OCFS2_BH_CACHED, inode);
743+ OCFS2_BH_CACHED);
744 if (ret) {
745 mlog_errno(ret);
746 return ret;
747@@ -2929,8 +2925,8 @@ static int ocfs2_defrag_xattr_bucket(str
748 if (!bhs)
749 return -ENOMEM;
750
751- ret = ocfs2_read_blocks(osb, blkno, blk_per_bucket, bhs,
752- OCFS2_BH_CACHED, inode);
753+ ret = ocfs2_read_blocks(inode, blkno, blk_per_bucket, bhs,
754+ OCFS2_BH_CACHED);
755 if (ret)
756 goto out;
757
758@@ -3130,8 +3126,8 @@ static int ocfs2_mv_xattr_bucket_cross_c
759 goto out;
760 }
761
762- ret = ocfs2_read_block(osb, prev_blkno,
763- &old_bh, OCFS2_BH_CACHED, inode);
764+ ret = ocfs2_read_block(inode, prev_blkno,
765+ &old_bh, OCFS2_BH_CACHED);
766 if (ret < 0) {
767 mlog_errno(ret);
768 brelse(new_bh);
769@@ -3184,9 +3180,9 @@ static int ocfs2_read_xattr_bucket(struc
770 u16 i, blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
771
772 if (!new)
773- return ocfs2_read_blocks(OCFS2_SB(inode->i_sb), blkno,
774+ return ocfs2_read_blocks(inode, blkno,
775 blk_per_bucket, bhs,
776- OCFS2_BH_CACHED, inode);
777+ OCFS2_BH_CACHED);
778
779 for (i = 0; i < blk_per_bucket; i++) {
780 bhs[i] = sb_getblk(inode->i_sb, blkno + i);
781@@ -3501,7 +3497,7 @@ static int ocfs2_cp_xattr_cluster(struct
782 ocfs2_journal_dirty(handle, first_bh);
783
784 /* update the new bucket header. */
785- ret = ocfs2_read_block(osb, to_blk_start, &bh, OCFS2_BH_CACHED, inode);
786+ ret = ocfs2_read_block(inode, to_blk_start, &bh, OCFS2_BH_CACHED);
787 if (ret < 0) {
788 mlog_errno(ret);
789 goto out;
790@@ -3888,8 +3884,8 @@ static int ocfs2_add_new_xattr_bucket(st
791 goto out;
792 }
793
794- ret = ocfs2_read_block(osb, p_blkno,
795- &first_bh, OCFS2_BH_CACHED, inode);
796+ ret = ocfs2_read_block(inode, p_blkno,
797+ &first_bh, OCFS2_BH_CACHED);
798 if (ret) {
799 mlog_errno(ret);
800 goto out;
801@@ -4131,10 +4127,10 @@ static int ocfs2_xattr_set_entry_in_buck
802 (unsigned long long)xs->bucket.bhs[0]->b_blocknr);
803
804 if (!xs->bucket.bhs[1]) {
805- ret = ocfs2_read_blocks(osb,
806+ ret = ocfs2_read_blocks(inode,
807 xs->bucket.bhs[0]->b_blocknr + 1,
808 blk_per_bucket - 1, &xs->bucket.bhs[1],
809- OCFS2_BH_CACHED, inode);
810+ OCFS2_BH_CACHED);
811 if (ret) {
812 mlog_errno(ret);
813 goto out;
814@@ -4240,8 +4236,8 @@ static int ocfs2_xattr_bucket_value_trun
815 BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize);
816 value_blk += header_bh->b_blocknr;
817
818- ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), value_blk,
819- &value_bh, OCFS2_BH_CACHED, inode);
820+ ret = ocfs2_read_block(inode, value_blk,
821+ &value_bh, OCFS2_BH_CACHED);
822 if (ret) {
823 mlog_errno(ret);
824 goto out;