Skip to content

Commit

Permalink
[GFS2] Function meta_read optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Jan 25, 2008
1 parent b0d5fd3 commit 15c7cee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/gfs2/meta_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,14 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
struct buffer_head **bhp)
{
*bhp = getbuf(gl, blkno, CREATE);
if (!buffer_uptodate(*bhp))
if (!buffer_uptodate(*bhp)) {
ll_rw_block(READ_META, 1, bhp);
if (flags & DIO_WAIT) {
int error = gfs2_meta_wait(gl->gl_sbd, *bhp);
if (error) {
brelse(*bhp);
return error;
if (flags & DIO_WAIT) {
int error = gfs2_meta_wait(gl->gl_sbd, *bhp);
if (error) {
brelse(*bhp);
return error;
}
}
}

Expand Down

0 comments on commit 15c7cee

Please sign in to comment.