]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Clean up applications to not use EXT2FS_ENABLE_SWAPFS or EXT2_FLAG_SWAP_BYTES
authorTheodore Ts'o <tytso@mit.edu>
Sat, 11 Aug 2007 06:57:31 +0000 (02:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Aug 2007 06:57:31 +0000 (02:57 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/logdump.c
e2fsck/journal.c
e2fsck/util.c
misc/dumpe2fs.c
misc/e2image.c

index 2bf67b575e04a5fa3d3044c36d53403d531a61ef..724193e3c545d3a000fe4b5f5a7505b7c78f2bb7 100644 (file)
@@ -350,7 +350,7 @@ static void dump_journal(char *cmdname, FILE *out_file,
 
        jsb = (journal_superblock_t *) buf;
        sb = (struct ext2_super_block *) (buf+1024);
-#ifdef ENABLE_SWAPFS
+#ifdef WORDS_BIGENDIAN
        if (sb->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC)) 
                ext2fs_swap_super(sb);
 #endif
index 756bbcb2cb726a6aa6593d63b478126bf3fc48f5..eebd22fd6605b9d5d78f8ff517f7371fe86ffa4d 100644 (file)
@@ -385,7 +385,7 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
                memcpy(&jsuper, start ? bh->b_data :  bh->b_data + 1024,
                       sizeof(jsuper));
                brelse(bh);
-#ifdef EXT2FS_ENABLE_SWAPFS
+#ifdef WORDS_BIGENDIAN
                if (jsuper.s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC)) 
                        ext2fs_swap_super(&jsuper);
 #endif
index 59a08b909486a9c6600a542b3d75274d13bd65ac..ba7ef4a09f9d656c95a7a03c7d7eed7887b223ce 100644 (file)
@@ -481,7 +481,7 @@ blk_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs, const char *name,
                if (io_channel_read_blk(io, superblock,
                                        -SUPERBLOCK_SIZE, buf))
                        continue;
-#ifdef EXT2FS_ENABLE_SWAPFS
+#ifdef WORDS_BIGENDIAN
                if (sb->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))
                        ext2fs_swap_super(sb);
 #endif
index b1dc607ff5984c9be5d87d5bde8384b52fccbc0c..d4d95bb51c6e614fd5e608e897698e7bf8c98bcd 100644 (file)
@@ -344,7 +344,6 @@ int main (int argc, char ** argv)
        int             force = 0;
        int             flags;
        int             header_only = 0;
-       int             big_endian;
        int             c;
 
 #ifdef ENABLE_NLS
@@ -415,12 +414,6 @@ int main (int argc, char ** argv)
        if (print_badblocks) {
                list_bad_blocks(fs, 1);
        } else {
-               big_endian = ((fs->flags & EXT2_FLAG_SWAP_BYTES) != 0);
-#ifdef WORDS_BIGENDIAN
-               big_endian = !big_endian;
-#endif
-               if (big_endian)
-                       printf(_("Note: This is a byte-swapped filesystem\n"));
                list_super (fs->super);
                if (fs->super->s_feature_incompat &
                      EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
index dd13cea5ebdbdc9ff802fb75f9841706fa8f6730..1fbb2676a654a66c88ec10bd80cc75810836a835 100644 (file)
@@ -346,9 +346,8 @@ static void scramble_dir_block(ext2_filsys fs, blk_t blk, char *buf)
        for (p = buf; p < end-8; p += rec_len) {
                dirent = (struct ext2_dir_entry_2 *) p;
                rec_len = dirent->rec_len;
-#ifdef EXT2FS_ENABLE_SWAPFS
-               if (fs->flags & EXT2_FLAG_SWAP_BYTES) 
-                       rec_len = ext2fs_swab16(rec_len);
+#ifdef WORDS_BIGENDIAN
+               rec_len = ext2fs_swab16(rec_len);
 #endif
 #if 0
                printf("rec_len = %d, name_len = %d\n", rec_len, dirent->name_len);
@@ -359,8 +358,7 @@ static void scramble_dir_block(ext2_filsys fs, blk_t blk, char *buf)
                               "bad rec_len (%d)\n", (unsigned long) blk, 
                               rec_len);
                        rec_len = end - p;
-#ifdef EXT2FS_ENABLE_SWAPFS
-                       if (fs->flags & EXT2_FLAG_SWAP_BYTES) 
+#ifdef WORDS_BIGENDIAN
                                dirent->rec_len = ext2fs_swab16(rec_len);
 #endif
                        continue;