Add one-shot feature for yaffs auto checkpointing.
[yaffs2.git] / yaffs_fs.c
index 95538ab4ea2210ee6278847b5260a7a50a3cc115..efaacac4b9c41de2bf3c50aa420ca0136be9e81f 100644 (file)
@@ -1937,17 +1937,23 @@ static int yaffs_do_sync_fs(struct super_block *sb, int do_checkpoint)
 {
 
        yaffs_Device *dev = yaffs_SuperToDevice(sb);
+       unsigned int oneshot_checkpoint = (yaffs_auto_checkpoint & 4);
+
        T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, 
-               ("yaffs_do_sync_fs: %s %s\n", 
+               ("yaffs_do_sync_fs: %s %s%s\n",
                sb->s_dirt ? "dirty" : "clean",
-               do_checkpoint ? "with checkpoint" : "no checkpoint"));
+               do_checkpoint ? "with checkpoint" : "no checkpoint",
+               oneshot_checkpoint ? " one-shot" : "" ));
 
-       if (sb->s_dirt) {
+       if (sb->s_dirt || oneshot_checkpoint) {
                yaffs_GrossLock(dev);
                yaffs_FlushSuperBlock(sb,do_checkpoint);
                yaffs_GrossUnlock(dev);
 
                sb->s_dirt = 0;
+
+               if(oneshot_checkpoint)
+                       yaffs_auto_checkpoint &= ~4;
        }
        return 0;
 }