ChangeLog, Makefile.in, swapfs.c, unix.c:
Makefile.in: Add message.c and swapfs.c to the list of source files to
build the make depend.
swapfs.c, unix.c: Only support the -s and -S options to e2fsck if
ENABLE_SWAPFS is defined.
Many files:
ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c,
native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the
byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a
big-endian machine.
initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set
EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag.
native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by
autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 2abbb2a..96ddf49 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -119,12 +119,14 @@
if (fs->orig_super)
memcpy(fs->orig_super, fs->super, SUPERBLOCK_SIZE);
+#ifdef EXT2FS_ENABLE_SWAPFS
if ((fs->super->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC)) ||
(fs->flags & EXT2_FLAG_SWAP_BYTES)) {
fs->flags |= EXT2_FLAG_SWAP_BYTES;
ext2fs_swap_super(fs->super);
}
+#endif
if (fs->super->s_magic != EXT2_SUPER_MAGIC) {
retval = EXT2_ET_BAD_MAGIC;
@@ -216,6 +218,7 @@
if (retval)
goto cleanup;
group_block++;
+#ifdef EXT2FS_ENABLE_SWAPFS
if (fs->flags & EXT2_FLAG_SWAP_BYTES) {
gdp = (struct ext2_group_desc *) dest;
groups_per_block = fs->blocksize /
@@ -223,6 +226,7 @@
for (j=0; j < groups_per_block; j++)
ext2fs_swap_group_desc(gdp++);
}
+#endif
dest += fs->blocksize;
}