Commit 15c7cee7 authored by Bob Peterson's avatar Bob Peterson Committed by Steven Whitehouse
Browse files

[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: default avatarBob Peterson <>
Signed-off-by: default avatarSteven Whitehouse <>
parent b0d5fd30
...@@ -222,13 +222,14 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, ...@@ -222,13 +222,14 @@ 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);
if (error) { if (error) {
brelse(*bhp); brelse(*bhp);
return error; return error;
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment