summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authoruebayasi <uebayasi@NetBSD.org>2010-01-29 04:36:20 +0000
committeruebayasi <uebayasi@NetBSD.org>2010-01-29 04:36:20 +0000
commit53000cec2343c77e2e4277c0365eb052d8d9da38 (patch)
tree4b0df315c2797ed040a8c0dec0d96e1c0b0c99c8 /sys/miscfs
parentf4e16ac91bc4692fec65df2fa49de0fc7aa5328b (diff)
genfs_getpages: Narrow & clarify the context where I/O happens & vmobjlock is dropped.
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/genfs/genfs_io.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/miscfs/genfs/genfs_io.c b/sys/miscfs/genfs/genfs_io.c
index 4cf7ce4e5d7..574cb168d3b 100644
--- a/sys/miscfs/genfs/genfs_io.c
+++ b/sys/miscfs/genfs/genfs_io.c
@@ -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 @@ startover:
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 @@ startover:
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 @@ loopdone:
genfs_node_unlock(vp);
putiobuf(mbp);
+ }
mutex_enter(&uobj->vmobjlock);
@@ -654,7 +656,6 @@ loopdone:
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);