]> git.neil.brown.name Git - LaFS.git/commitdiff
Remove lafs_write_super.
authorNeilBrown <neilb@suse.de>
Fri, 2 Jul 2010 23:44:25 +0000 (09:44 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 3 Jul 2010 00:16:13 +0000 (10:16 +1000)
We don't really want to do anything of lafs_write_super
as we write the superblock when needed anyway.
However lafs_sync_fs needs to do what lafs_write_super was doing,
at least sometimes.

lafs_sync_fs will now force a checkpoint exactly when s_dirt is
set.  So revise those setting a little - I think we only want this if
there are dirty inodes to flush. but that needs to be thought about
more when I fix write_inode.

Signed-off-by: NeilBrown <neilb@suse.de>
block.c
inode.c
super.c

diff --git a/block.c b/block.c
index 3304a95781ded09a27f0d4fe4b4e938930b97a86..7091a8c897cb41b1c13de60f889b4d4b0a9bedd6 100644 (file)
--- a/block.c
+++ b/block.c
@@ -490,8 +490,6 @@ void
 lafs_dirty_dblock(struct datablock *b)
 {
        LAFS_BUG(!test_bit(B_Valid, &b->b.flags), &b->b);
-       if (test_bit(B_Pinned, &b->b.flags))
-               b->b.inode->i_sb->s_dirt = 1;
        /*
         * FIXME maybe check we aren't dirtying a dirty block
         * in the previous phase.
@@ -636,6 +634,4 @@ lafs_dirty_iblock(struct indexblock *b)
                        if (test_and_set_bit(B_UnincCredit, &b->b.flags))
                                /* race - we didn't need it after all */
                                lafs_space_return(fs_from_inode(b->b.inode), 1);
-
-       b->b.inode->i_sb->s_dirt = 1;
 }
diff --git a/inode.c b/inode.c
index 17acaf76ae195eea188593e5ba5c4b65ee9b398c..f539487e20a35180cef67522b4a265adea0af62b 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -879,6 +879,7 @@ void lafs_dirty_inode(struct inode *ino)
         * (e.g. in setattr) will do that.
         */
        set_bit(I_Dirty, &LAFSI(ino)->iflags);
+       ino->i_sb->s_dirt = 1;
 }
 
 int lafs_write_inode(struct inode *ino, int wait)
diff --git a/super.c b/super.c
index efc2071054bb80deb624d24f494fe8cf0d35aac6..3fa87ae4d43d3c2cf8cff260cc340b2623a6da91 100644 (file)
--- a/super.c
+++ b/super.c
@@ -975,19 +975,14 @@ void lafs_destroy_inode(struct inode *inode)
        }
 }
 
-static void lafs_write_super(struct super_block *sb)
-{
-       struct fs *fs = sb->s_fs_info;
-
-       lafs_checkpoint_start(fs);
-}
-
 static int lafs_sync_fs(struct super_block *sb, int wait)
 {
        struct fs *fs = sb->s_fs_info;
        if (!wait)
-               /* FIXME why do I need this here? */
-               lafs_cluster_flush(fs, 0);
+               /* We only reach here if s_dirt was set, so it
+                * is reasonable to force a checkpoint.
+                */
+               lafs_checkpoint_start(fs);
        else
                printk("FIXME I should wait for the checkpoint to finish\n");
        return 0;
@@ -1051,7 +1046,6 @@ static struct super_operations lafs_sops = {
        .clear_inode    = lafs_clear_inode,    /* forget internal state of this inode */
        .delete_inode   = lafs_delete_inode,   /* remove this inode from filesystem */
        .put_super      = lafs_put_super,
-       .write_super    = lafs_write_super,
        .sync_fs        = lafs_sync_fs,
        /* write_super_lockfs ?? */
        /* unlockfs ?? */