Subject: genfs_putpages with PGO_SYNCIO
To: None <tech-kern@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 01/11/2003 01:26:22
--NextPart-20030111012300-0034800
Content-Type: Text/Plain; charset=us-ascii

hi,

when genfs_putpages is called with PGO_SYNCIO,
it passes the flag to GOP_WRITE as well.  and GOP_WRITE do i/o synchronously.
but it seems redundant to me because after that, genfs_putpages will wait
for i/o completetion by itsself.
is attached patch ok?
thanks.

YAMAMOTO Takashi

--NextPart-20030111012300-0034800
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="genfs.syncio.diff"

Index: genfs_vnops.c
===================================================================
RCS file: /cvs/NetBSD/src/sys/miscfs/genfs/genfs_vnops.c,v
retrieving revision 1.68
diff -u -p -r1.68 genfs_vnops.c
--- genfs_vnops.c	2002/11/15 14:01:57	1.68
+++ genfs_vnops.c	2003/01/10 16:14:58
@@ -1281,7 +1291,12 @@ genfs_putpages(void *v)
 				    listq);
 			}
 			simple_unlock(slock);
-			error = GOP_WRITE(vp, pgs, npages, flags);
+			KASSERT(!wasclean);
+			/*
+			 * no need to wait for PGO_SYNCIO here
+			 * because we'll do so later.
+			 */
+			error = GOP_WRITE(vp, pgs, npages, flags & ~PGO_SYNCIO);
 			simple_lock(slock);
 			if (by_list) {
 				pg = TAILQ_NEXT(&curmp, listq);

--NextPart-20030111012300-0034800--