diff options
author | Bob Peterson <rpeterso@redhat.com> | 2007-12-11 20:29:17 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 03:14:33 -0500 |
commit | 15c7cee7995a9013f1b2f31a15b70e1d2e8ae501 (patch) | |
tree | 22646442ffd942d77fc34f168d270e7bd2668643 /fs | |
parent | b0d5fd307463405fe1f57494fbb37f810715ed6d (diff) |
[GFS2] Function meta_read optimization
This patch optimizes function gfs2_meta_read. Basically, gfs2_meta_wait
was being called regardless of whether a disk read was requested.
This just pulls that wait into the if that triggers the read.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/meta_io.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 4b1aced9023d..3144d35a6261 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -222,13 +222,14 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, | |||
222 | struct buffer_head **bhp) | 222 | struct buffer_head **bhp) |
223 | { | 223 | { |
224 | *bhp = getbuf(gl, blkno, CREATE); | 224 | *bhp = getbuf(gl, blkno, CREATE); |
225 | if (!buffer_uptodate(*bhp)) | 225 | if (!buffer_uptodate(*bhp)) { |
226 | ll_rw_block(READ_META, 1, bhp); | 226 | ll_rw_block(READ_META, 1, bhp); |
227 | if (flags & DIO_WAIT) { | 227 | if (flags & DIO_WAIT) { |
228 | int error = gfs2_meta_wait(gl->gl_sbd, *bhp); | 228 | int error = gfs2_meta_wait(gl->gl_sbd, *bhp); |
229 | if (error) { | 229 | if (error) { |
230 | brelse(*bhp); | 230 | brelse(*bhp); |
231 | return error; | 231 | return error; |
232 | } | ||
232 | } | 233 | } |
233 | } | 234 | } |
234 | 235 | ||