}
-static void swap_sb (struct superblock *sb) {
+void swap_sb (struct superblock *sb) {
swap32 (sb->s_inodes_count);
swap32 (sb->s_blocks_count);
struct directory *shrink_dir (struct dirwalker *dw, unsigned long nod, const char *name, unsigned short nlen);
char *dir_name (struct dirwalker *dw);
+
void init_bw (struct blockwalker *bw);
+void swap_sb (struct superblock *sb);
void extend_inode_blk (struct filesystem *fs, struct inode_pos *ipos, unsigned char *b, signed long amount);
void finish_fs (struct filesystem *fs);
}
+ if (bigendian) {
+ swap_sb (&sup);
+ }
+
if (sup.s_magic[0] != (EXT2_SUPER_MAGIC & 0xff) || sup.s_magic[1] != ((EXT2_SUPER_MAGIC >> 8) & 0xff)) {
report_at (program_name, 0, REPORT_ERROR, "'%s' has a unsupported file system", outfile);
}
+ if (bigendian) {
+ swap_sb (&sup);
+ }
+
if (sup.s_magic[0] != (EXT2_SUPER_MAGIC & 0xff) || sup.s_magic[1] != ((EXT2_SUPER_MAGIC >> 8) & 0xff)) {
report_at (program_name, 0, REPORT_ERROR, "'%s' has a unsupported file system", outfile);