diff --git a/sys/fs/puffs/puffs_msgif.h b/sys/fs/puffs/puffs_msgif.h index e5da41778143..bf88bf5248ff 100644 --- a/sys/fs/puffs/puffs_msgif.h +++ b/sys/fs/puffs/puffs_msgif.h @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_msgif.h,v 1.27 2007/04/16 13:03:26 pooka Exp $ */ +/* $NetBSD: puffs_msgif.h,v 1.28 2007/04/22 18:02:05 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -105,7 +105,8 @@ struct puffs_kargs { #define PUFFS_KFLAG_ALLOWCTL 0x01 /* ioctl/fcntl commands allowed */ #define PUFFS_KFLAG_NOCACHE 0x02 /* flush page cache immediately */ #define PUFFS_KFLAG_ALLOPS 0x04 /* ignore pa_vnopmask, send all */ -#define PUFFS_KFLAG_MASK 0x07 +#define PUFFS_KFLAG_WTCACHE 0x08 /* page cache is write-through */ +#define PUFFS_KFLAG_MASK 0x0f #define PUFFS_FHFLAG_DYNAMIC 0x01 #define PUFFS_FHFLAG_NFSV2 0x02 diff --git a/sys/fs/puffs/puffs_vnops.c b/sys/fs/puffs/puffs_vnops.c index 58c86a41c4e8..8fd0d98a0c52 100644 --- a/sys/fs/puffs/puffs_vnops.c +++ b/sys/fs/puffs/puffs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vnops.c,v 1.61 2007/04/20 11:56:35 pooka Exp $ */ +/* $NetBSD: puffs_vnops.c,v 1.62 2007/04/22 18:02:05 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.61 2007/04/20 11:56:35 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.62 2007/04/22 18:02:05 pooka Exp $"); #include #include @@ -1572,11 +1572,18 @@ puffs_write(void *v) } } + /* synchronous I/O? */ if (error == 0 && ap->a_ioflag & IO_SYNC) { simple_lock(&vp->v_interlock); error = VOP_PUTPAGES(vp, trunc_page(origoff), round_page(uio->uio_offset), PGO_CLEANIT | PGO_SYNCIO); + + /* write though page cache? */ + } else if (error == 0 && pmp->pmp_flags & PUFFS_KFLAG_WTCACHE) { + simple_lock(&vp->v_interlock); + error = VOP_PUTPAGES(vp, trunc_page(origoff), + round_page(uio->uio_offset), PGO_CLEANIT); } puffs_updatenode(vp, uflags);