[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [GFS2] [Patch 10/10] Function meta_read optimization



Hi,

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.

Regards,

Bob Peterson
Red Hat GFS

Signed-off-by: Bob Peterson <rpeterso redhat com> 
--
 .../fs/gfs2/meta_io.c                              |   13 +++++++------
  1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gfs2-2.6.git.patch9/fs/gfs2/meta_io.c b/gfs2-2.6.git.patch10/fs/gfs2/meta_io.c
index 9fdbfd3..f7400c4 100644
--- a/gfs2-2.6.git.patch9/fs/gfs2/meta_io.c
+++ b/gfs2-2.6.git.patch10/fs/gfs2/meta_io.c
@@ -201,13 +201,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;
+			}
 		}
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]