[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>
This commit is contained in:
committed by
Steven Whitehouse
parent
b0d5fd3074
commit
15c7cee799
@@ -222,7 +222,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
|
|||||||
struct buffer_head **bhp)
|
struct buffer_head **bhp)
|
||||||
{
|
{
|
||||||
*bhp = getbuf(gl, blkno, CREATE);
|
*bhp = getbuf(gl, blkno, CREATE);
|
||||||
if (!buffer_uptodate(*bhp))
|
if (!buffer_uptodate(*bhp)) {
|
||||||
ll_rw_block(READ_META, 1, bhp);
|
ll_rw_block(READ_META, 1, bhp);
|
||||||
if (flags & DIO_WAIT) {
|
if (flags & DIO_WAIT) {
|
||||||
int error = gfs2_meta_wait(gl->gl_sbd, *bhp);
|
int error = gfs2_meta_wait(gl->gl_sbd, *bhp);
|
||||||
@@ -231,6 +231,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user