From: Bob Peterson Date: Wed, 12 Dec 2007 01:29:17 +0000 (-0600) Subject: [GFS2] Function meta_read optimization X-Git-Tag: v2.6.25-rc1~1241^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=15c7cee7995a9013f1b2f31a15b70e1d2e8ae501;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 4b1aced9023..3144d35a626 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, 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; + } } }