From: Theodore Ts'o Date: Wed, 13 Dec 2000 17:55:49 +0000 (+0000) Subject: ChangeLog, closefs.c, ext2fs.h, jump.funcs: X-Git-Tag: E2FSPROGS-1_20~196 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3fe973b3068f68bb9d3ea6ba309dc7d2df30301f;p=tools%2Fe2fsprogs.git ChangeLog, closefs.c, ext2fs.h, jump.funcs: closefs.c (ext2fs_update_fs_dynamic_rev): New function suggested by Andreas Dilger to update the filesystem revision to EXT2_DYNAMIC_REV. --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 1bdfaff..fb92e08 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,9 @@ 2000-12-13 Theodore Ts'o + * 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. diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c index 8ca6b47..b9700cd 100644 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@ -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; diff --git a/lib/ext2fs/dll/jump.funcs b/lib/ext2fs/dll/jump.funcs index cc7acaa..2a18e8f 100644 --- a/lib/ext2fs/dll/jump.funcs +++ b/lib/ext2fs/dll/jump.funcs @@ -173,3 +173,4 @@ 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 diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index 3c428dc..bde3826 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -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,