From: Theodore Ts'o <tytso@mit.edu>
To: jrs@us.ibm.com
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: [PATCH] Clean up applications to not use EXT2FS_ENABLE_SWAPFS or EXT2_FLAG_SWAP_BYTES
Date: Sun, 12 Aug 2007 12:57:20 -0400 [thread overview]
Message-ID: <11869378423190-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1186937842710-git-send-email-tytso@mit.edu>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
debugfs/logdump.c | 2 +-
e2fsck/journal.c | 2 +-
e2fsck/util.c | 2 +-
misc/dumpe2fs.c | 7 -------
misc/e2image.c | 8 +++-----
5 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index 2bf67b5..724193e 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 756bbcb..eebd22f 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 59a08b9..ba7ef4a 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 b1dc607..d4d95bb 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 dd13cea..1fbb267 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;
--
1.5.3.rc4.67.gf9286
next prev parent reply other threads:[~2007-08-12 16:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-07 21:16 [PATCH][e2fsprogs] Move ext2fs_struct_generic_bitmap back into ext2fs.h Jose R. Santos
2007-08-09 21:42 ` Theodore Tso
2007-08-12 16:57 ` Theodore Ts'o
2007-08-12 16:57 ` [PATCH] Remove e2fsck's -s and -S options to byte-swap ancient PPC filesystems Theodore Ts'o
2007-08-12 16:57 ` [PATCH] Remove e2fsck's swapfs test, since we've removed the functionality Theodore Ts'o
2007-08-12 16:57 ` [PATCH] Remove PowerPC bitmap hackery since it's not been needed since Linux 2.1 Theodore Ts'o
2007-08-12 16:57 ` [PATCH] Clean up libext2fs by byte swapping iff WORDS_BIGENDIAN Theodore Ts'o
2007-08-12 16:57 ` Theodore Ts'o [this message]
2007-08-12 16:57 ` [PATCH] Remove configure --enable-swapfs and associated support #defines Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11869378423190-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=jrs@us.ibm.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).