]> git.neil.brown.name Git - LaFS.git/commitdiff
reset newblocks for each checkpoint
authorNeilBrown <neilb@suse.de>
Fri, 2 Jul 2010 23:17:18 +0000 (09:17 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 3 Jul 2010 00:00:07 +0000 (10:00 +1000)
newblocks is the count of new blocks written to the filesystem in this
checkpoint (roughly the amount of work that roll-forward would have to
do).  We use it to trigger new checkpoints.
So we need to reset it after each checkpoint.

Signed-off-by: NeilBrown <neilb@suse.de>
checkpoint.c
state.h

index f484e57bfbd84c032870a1aab070a4bff6770bbb..5563d6304860d53a19bdb1968ddf8bec42d74524 100644 (file)
@@ -504,6 +504,7 @@ static void finish_checkpoint(struct fs *fs, int youth)
        /* FIXME might I now be racing with unmount and module unload??? */
 
        fs->checkpoint_youth = youth;
+       fs->newblocks = 0;
        lafs_wake_cleaner(fs);
 }
 
diff --git a/state.h b/state.h
index 96e634caacc1fe3bacd86c7c9064b4f5ff79606d..b9d462f6b5a015be6b44b6682a10d87009d92079 100644 (file)
--- a/state.h
+++ b/state.h
@@ -134,7 +134,10 @@ struct fs {
        } cleaner;
        struct task_struct *cleaner_thread;
 
-       unsigned long newblocks;        /* number of blocks written since checkpoint */
+       unsigned long newblocks;        /* number of blocks written since checkpoint
+                                        * FIXME this should probably be a count
+                                        * of segments (?)
+                                        */
        unsigned long max_newblocks;    /* max blocks in a checkpoint (roughly) */
 
        /* counters for (pre)allocating space. */