Whamcloud - gitweb
Speed up journal recovery in userspace by avoiding a pointless
authorTheodore Ts'o <tytso@mit.edu>
Tue, 10 Jul 2001 18:27:58 +0000 (14:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 10 Jul 2001 18:27:58 +0000 (14:27 -0400)
unconditional ext2_flush() call.  Also made ext2_flush() more
efficient when the superblock is modified after the filesystem has
been flushed, and make it clear the superblock dirty flag
after doing the superblock/block group descriptor flush.

e2fsck/ChangeLog
e2fsck/journal.c
lib/ext2fs/ChangeLog
lib/ext2fs/closefs.c

index 55b14c7..3432de9 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-10  Theodore Tso  <tytso@valinux.com>
+
+       * journal.c (e2fsck_run_ext3_journal): Only call ext3_flush() if
+               the superblock is dirty.
+
 2001-07-07  Theodore Tso  <tytso@valinux.com>
 
        * pass1b.c (pass1b, process_pass1b_block): Change the num_bad
index dbfa118..96329df 100644 (file)
@@ -716,7 +716,8 @@ int e2fsck_run_ext3_journal(e2fsck_t ctx)
                return EXT2_ET_FILE_RO;
        }
 
-       ext2fs_flush(ctx->fs);  /* Force out any modifications */
+       if (fs->flags & EXT2_FLAG_DIRTY)
+               ext2fs_flush(ctx->fs);  /* Force out any modifications */
 
        recover_retval = recover_ext3_journal(ctx);
        
index 987b586..cd881e8 100644 (file)
@@ -1,3 +1,12 @@
+2001-07-10  Theodore Tso  <tytso@valinux.com>
+
+       * closefs.c (write_primary_superblock): After writing changes to
+               the primary superblock, update the original superblock
+               copy so we don't have to re-write those changes in the
+               future.
+               (ext2fs_flush): Clear the superblock dirty flag after
+               we've flushed out changes to disk.
+
 2001-07-07  Theodore Tso  <tytso@valinux.com>
 
        * bitops.h (ext2fs_find_first_bit_set): Use %esi instead of %ebx
index 69a769f..f52c343 100644 (file)
@@ -91,6 +91,7 @@ static errcode_t write_primary_superblock(ext2_filsys fs,
                if (retval)
                        return retval;
        }
+       memcpy(fs->orig_super, super, SUPERBLOCK_SIZE);
        return 0;
 }
 
@@ -251,6 +252,8 @@ errcode_t ext2fs_flush(ext2_filsys fs)
                        goto errout;
        }
 
+       fs->flags &= ~EXT2_FLAG_DIRTY;
+
        /*
         * Flush the blocks out to disk
         */