Subject: How to capture all file system writes
To: None <tech-kern@netbsd.org>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: tech-kern
Date: 10/20/2003 20:47:58
I'm looking for possible strategies for file system snapshots.  Will this
addition to `sys/kern/vfs_bio.c::bwrite(struct buf *bp)' catch all writes
from a mounted file system to the block device it is mounted on?
 
 	/* Initiate disk write.  Make sure the appropriate party is charged. */
 	V_INCR_NUMOUTPUT(bp->b_vp);
 	simple_unlock(&bp->b_interlock);
+
+	/* mp is bp->b_vp->v_mount */
+#if NFSSNAP > 0
+	if (mp != NULL && ISSET(mp->mnt_iflag, IMNT_SNAPSHOT))
+		fssnap_lookup(bp);
+#endif
 	splx(s);
 
 	VOP_STRATEGY(bp);
 
-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)