From: Theodore Ts'o Date: Sat, 11 Aug 2007 06:57:31 +0000 (-0400) Subject: Clean up applications to not use EXT2FS_ENABLE_SWAPFS or EXT2_FLAG_SWAP_BYTES X-Git-Tag: v1.41-WIP-0427~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2eae093081a097a0a611fe2817e1533825dfdd86;p=thirdparty%2Fe2fsprogs.git Clean up applications to not use EXT2FS_ENABLE_SWAPFS or EXT2_FLAG_SWAP_BYTES Signed-off-by: "Theodore Ts'o" --- diff --git a/debugfs/logdump.c b/debugfs/logdump.c index 2bf67b575..724193e3c 100644 --- a/debugfs/logdump.c +++ b/debugfs/logdump.c @@ -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 diff --git a/e2fsck/journal.c b/e2fsck/journal.c index 756bbcb2c..eebd22fd6 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -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 diff --git a/e2fsck/util.c b/e2fsck/util.c index 59a08b909..ba7ef4a09 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -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 diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index b1dc607ff..d4d95bb51 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -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) { diff --git a/misc/e2image.c b/misc/e2image.c index dd13cea5e..1fbb2676a 100644 --- a/misc/e2image.c +++ b/misc/e2image.c @@ -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;