Whamcloud - gitweb
ChangeLog, closefs.c, ext2fs.h, jump.funcs:
authorTheodore Ts'o <tytso@mit.edu>
Wed, 13 Dec 2000 17:55:49 +0000 (17:55 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Dec 2000 17:55:49 +0000 (17:55 +0000)
  closefs.c (ext2fs_update_fs_dynamic_rev): New function suggested by
   Andreas Dilger to update the filesystem revision to EXT2_DYNAMIC_REV.

lib/ext2fs/ChangeLog
lib/ext2fs/closefs.c
lib/ext2fs/dll/jump.funcs
lib/ext2fs/ext2fs.h

index 1bdfaff..fb92e08 100644 (file)
@@ -1,5 +1,9 @@
 2000-12-13  Theodore Ts'o  <tytso@valinux.com>
 
+       * closefs.c (ext2fs_update_fs_dynamic_rev): New function suggested
+               by Andreas Dilger to update the filesystem revision to
+               EXT2_DYNAMIC_REV.
+
        * swapfs.c (ext2fs_swap_super): Add byte swapping for the journal
                fields.
 
index 8ca6b47..b9700cd 100644 (file)
@@ -106,6 +106,23 @@ static errcode_t write_primary_superblock(ext2_filsys fs,
 }
 
 
+/*
+ * Updates the revision to EXT2_DYNAMIC_REV
+ */
+void ext2fs_update_fs_dynamic_rev(ext2_filsys fs)
+{
+       struct ext2_super_block *sb = fs->super;
+
+       if (sb->s_rev_level > EXT2_GOOD_OLD_REV)
+               return;
+
+       sb->s_rev_level = EXT2_DYNAMIC_REV;
+       sb->s_first_ino = EXT2_GOOD_OLD_FIRST_INO;
+       sb->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE;
+       /* s_uuid is handled by e2fsck already */
+       /* other fields should be left alone */
+}
+
 errcode_t ext2fs_flush(ext2_filsys fs)
 {
        dgrp_t          i,j,maxgroup,sgrp;
index cc7acaa..2a18e8f 100644 (file)
 00000000 T _ext2fs_read_bb_FILE2               libext2fs       read_bb_file
 00000000 T _ext2fs_write_bb_FILE               libext2fs       write_bb_file
 00000000 T _ext2fs_badblocks_equal             libext2fs       badblocks
+00000000 T _ext2fs_update_fs_dynamic_rev       libext2fs       closefs
index 3c428dc..bde3826 100644 (file)
@@ -646,6 +646,7 @@ extern errcode_t ext2fs_check_desc(ext2_filsys fs);
 extern errcode_t ext2fs_close(ext2_filsys fs);
 extern errcode_t ext2fs_flush(ext2_filsys fs);
 extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block);
+extern void ext2fs_update_fs_dynamic_rev(ext2_filsys fs);
 
 /* cmp_bitmaps.c */
 extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1,