]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch
CommitLineData
2cb7cef9
BS
1From: Joel Becker <joel.becker@oracle.com>
2Subject: ocfs2: Kill the last naked wait_on_buffer() for cached reads.
3Patch-mainline: 2.6.28
4
5ocfs2's cached buffer I/O goes through ocfs2_read_block(s)(). dir.c had
6a naked wait_on_buffer() to wait for some readahead, but it should
7use ocfs2_read_block() instead.
8
9Signed-off-by: Joel Becker <joel.becker@oracle.com>
10Signed-off-by: Mark Fasheh <mfasheh@suse.com>
11---
12 fs/ocfs2/dir.c | 7 +++----
13 1 files changed, 3 insertions(+), 4 deletions(-)
14
15Index: linux-2.6.27/fs/ocfs2/dir.c
16===================================================================
17--- linux-2.6.27.orig/fs/ocfs2/dir.c
18+++ linux-2.6.27/fs/ocfs2/dir.c
19@@ -302,14 +302,13 @@ restart:
20 }
21 if ((bh = bh_use[ra_ptr++]) == NULL)
22 goto next;
23- wait_on_buffer(bh);
24- if (!buffer_uptodate(bh)) {
25- /* read error, skip block & hope for the best */
26+ if (ocfs2_read_block(dir, block, &bh)) {
27+ /* read error, skip block & hope for the best.
28+ * ocfs2_read_block() has released the bh. */
29 ocfs2_error(dir->i_sb, "reading directory %llu, "
30 "offset %lu\n",
31 (unsigned long long)OCFS2_I(dir)->ip_blkno,
32 block);
33- brelse(bh);
34 goto next;
35 }
36 i = ocfs2_search_dirblock(bh, dir, name, namelen,