Module Name:    src
Committed By:   uebayasi
Date:           Fri Jan 29 04:36:20 UTC 2010

Modified Files:
        src/sys/miscfs/genfs: genfs_io.c

Log Message:
genfs_getpages: Narrow & clarify the context where I/O happens & vmobjlock is 
dropped.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/miscfs/genfs/genfs_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.33 src/sys/miscfs/genfs/genfs_io.c:1.34
--- src/sys/miscfs/genfs/genfs_io.c:1.33	Fri Jan 29 04:33:37 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Fri Jan 29 04:36:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.33 2010/01/29 04:33:37 uebayasi Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.34 2010/01/29 04:36:20 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.33 2010/01/29 04:33:37 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.34 2010/01/29 04:36:20 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -352,12 +352,6 @@
 		goto out;
 	}
 
-    {
-	size_t bytes, iobytes, tailstart, tailbytes, totalbytes, skipbytes;
-	vaddr_t kva;
-	struct buf *bp, *mbp;
-	bool sawhole = false;
-
 	/*
 	 * the page wasn't resident and we're not overwriting,
 	 * so we're going to have to do some i/o.
@@ -390,8 +384,15 @@
 			goto out_err_free;
 		}
 	}
+
 	mutex_exit(&uobj->vmobjlock);
 
+    {
+	size_t bytes, iobytes, tailstart, tailbytes, totalbytes, skipbytes;
+	vaddr_t kva;
+	struct buf *bp, *mbp;
+	bool sawhole = false;
+
 	/*
 	 * read the desired page(s).
 	 */
@@ -624,6 +625,7 @@
 	genfs_node_unlock(vp);
 
 	putiobuf(mbp);
+    }
 
 	mutex_enter(&uobj->vmobjlock);
 
@@ -654,7 +656,6 @@
 		UVMHIST_LOG(ubchist, "returning error %d", error,0,0,0);
 		goto out_err_free;
 	}
-    }
 
 out:
 	UVMHIST_LOG(ubchist, "succeeding, npages %d", npages,0,0,0);

Reply via email to