Module Name:    src
Committed By:   pooka
Date:           Sat Apr 18 16:30:58 UTC 2009

Modified Files:
        src/sys/rump/librump/rumpvfs: genfs_io.c

Log Message:
* actually do syncer list add/remove instead of just pretending to
  play VI_ONWORKLST games
* honor PGO_LOCKED in getpages wrt. to interlock (no, we don't have
  a fault routine, so we don't need to seriously honor it)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/librump/rumpvfs/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/rump/librump/rumpvfs/genfs_io.c
diff -u src/sys/rump/librump/rumpvfs/genfs_io.c:1.12 src/sys/rump/librump/rumpvfs/genfs_io.c:1.13
--- src/sys/rump/librump/rumpvfs/genfs_io.c:1.12	Sat Apr 18 15:40:33 2009
+++ src/sys/rump/librump/rumpvfs/genfs_io.c	Sat Apr 18 16:30:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.12 2009/04/18 15:40:33 pooka Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.13 2009/04/18 16:30:58 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.12 2009/04/18 15:40:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.13 2009/04/18 16:30:58 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -87,6 +87,7 @@
 	int bshift = vp->v_mount->mnt_fs_bshift;
 	int bsize = 1<<bshift;
 	int count = *ap->a_count;
+	int opflags = ap->a_flags;
 	int async;
 	int i, error;
 
@@ -103,7 +104,8 @@
 		panic("%s: centeridx != not supported", __func__);
 
 	if (ap->a_access_type & VM_PROT_WRITE)
-		vp->v_iflag |= VI_ONWORKLST;
+		if ((vp->v_iflag & VI_ONWORKLST) == 0)
+			vn_syncer_add_to_worklist(vp, filedelay);
 
 	curoff = ap->a_offset & ~PAGE_MASK;
 	for (i = 0; i < count; i++, curoff += PAGE_SIZE) {
@@ -128,7 +130,8 @@
 
 	/* got everything?  if so, just return */
 	if (i == count) {
-		mutex_exit(&uobj->vmobjlock);
+		if ((opflags & PGO_LOCKED) == 0)
+			mutex_exit(&uobj->vmobjlock);
 		return 0;
 	}
 
@@ -255,6 +258,8 @@
 
 	kmem_free(tmpbuf, bufsize);
 
+	if (opflags & PGO_LOCKED)
+		mutex_enter(&uobj->vmobjlock);
 	return 0;
 }
 
@@ -345,7 +350,8 @@
 
 	/* all done? */
 	if (TAILQ_EMPTY(&uobj->memq)) {
-		vp->v_iflag &= ~VI_ONWORKLST;
+		if (LIST_FIRST(&vp->v_dirtyblkhd) == NULL)
+			vn_syncer_remove_from_worklist(vp);
 		mutex_exit(&uobj->vmobjlock);
 		return 0;
 	}

Reply via email to