new superblock header needs fixes for BE architectures
authorpelikan <pelikan@openbsd.org>
Sun, 13 Jul 2014 13:37:22 +0000 (13:37 +0000)
committerpelikan <pelikan@openbsd.org>
Sun, 13 Jul 2014 13:37:22 +0000 (13:37 +0000)
sbin/newfs_ext2fs/ext2fs_bswap.c
sbin/newfs_ext2fs/mke2fs.c

index 844d8cb..4ca700a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ext2fs_bswap.c,v 1.2 2014/07/11 22:23:20 miod Exp $   */
+/*     $OpenBSD: ext2fs_bswap.c,v 1.3 2014/07/13 13:37:22 pelikan Exp $        */
 /*     $NetBSD: ext2fs_bswap.c,v 1.6 2000/07/24 00:23:10 mycroft Exp $ */
 
 /*
@@ -58,7 +58,7 @@ e2fs_sb_bswap(struct ext2fs *old, struct ext2fs *new)
        new->e2fs_ficount       =       swap32(old->e2fs_ficount);
        new->e2fs_first_dblock  =       swap32(old->e2fs_first_dblock);
        new->e2fs_log_bsize     =       swap32(old->e2fs_log_bsize);
-       new->e2fs_fsize         =       swap32(old->e2fs_fsize);
+       new->e2fs_log_fsize     =       swap32(old->e2fs_log_fsize);
        new->e2fs_bpg           =       swap32(old->e2fs_bpg);
        new->e2fs_fpg           =       swap32(old->e2fs_fpg);
        new->e2fs_ipg           =       swap32(old->e2fs_ipg);
index a806c9e..d57f1d5 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: mke2fs.c,v 1.8 2014/07/11 15:16:22 pelikan Exp $ */
+/* $OpenBSD: mke2fs.c,v 1.9 2014/07/13 13:37:22 pelikan Exp $ */
 /*     $NetBSD: mke2fs.c,v 1.13 2009/10/19 18:41:08 bouyer Exp $       */
 
 /*-
@@ -238,10 +238,10 @@ mke2fs(const char *fsys, int fi, int fo)
        }
 
        sblock.e2fs.e2fs_log_bsize = ilog2(bsize) - LOG_MINBSIZE;
-       /* Umm, why not e2fs_log_fsize? */
-       sblock.e2fs.e2fs_fsize = ilog2(fsize) - LOG_MINBSIZE;
+       sblock.e2fs.e2fs_log_fsize = ilog2(fsize) - LOG_MINFSIZE;
 
        sblock.e2fs_bsize = bsize;
+       sblock.e2fs_fsize = fsize;
        sblock.e2fs_bshift = sblock.e2fs.e2fs_log_bsize + LOG_MINBSIZE;
        sblock.e2fs_qbmask = sblock.e2fs_bsize - 1;
        sblock.e2fs_bmask = ~sblock.e2fs_qbmask;