diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2014-05-22 14:04:42 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2014-05-22 14:04:42 +0000 |
commit | fa8ea6bf66873fadb0d460758bcab79c49c3cd24 (patch) | |
tree | 7573bebfdb44fd21c4d7ad1d3e45e96ff442bb4b /sbin/fsck_ext2fs/setup.c | |
parent | 2008e9964f6902eeac39711b03d90a8fefdc0627 (diff) |
Nuke pointless dev_bsize variable which is always set to 512, and just
use DEV_BSIZE.
Write sizes need to be secsize and not DEV_BSIZE, just like reads.
Equivalent to changes made in fsck_ffs.
Diffstat (limited to 'sbin/fsck_ext2fs/setup.c')
-rw-r--r-- | sbin/fsck_ext2fs/setup.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sbin/fsck_ext2fs/setup.c b/sbin/fsck_ext2fs/setup.c index 01b2d0de9a1..c99e0ce7895 100644 --- a/sbin/fsck_ext2fs/setup.c +++ b/sbin/fsck_ext2fs/setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setup.c,v 1.19 2013/11/22 04:38:02 guenther Exp $ */ +/* $OpenBSD: setup.c,v 1.20 2014/05/22 14:04:41 krw Exp $ */ /* $NetBSD: setup.c,v 1.1 1997/06/11 11:22:01 bouyer Exp $ */ /* @@ -107,9 +107,9 @@ setup(char *dev) if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL) errexit("cannot allocate space for superblock\n"); if ((lp = getdisklabel((char *)NULL, fsreadfd)) != NULL) - dev_bsize = secsize = lp->d_secsize; + secsize = lp->d_secsize; else - dev_bsize = secsize = DEV_BSIZE; + secsize = DEV_BSIZE; /* * Read in the superblock, looking for alternates if necessary */ @@ -253,7 +253,7 @@ badsblabel: static int readsb(int listerr) { - daddr32_t super = bflag ? bflag : SBOFF / dev_bsize; + daddr32_t super = bflag ? bflag : SBOFF / DEV_BSIZE; if (bread(fsreadfd, (char *)sblk.b_un.b_fs, super, (long)SBSIZE) != 0) return (0); @@ -294,9 +294,7 @@ readsb(int listerr) * according to fsbtodb, and adjust superblock block number * so we can tell if this is an alternate later. */ - super *= dev_bsize; - dev_bsize = sblock.e2fs_bsize / fsbtodb(&sblock, 1); - sblk.b_bno = super / dev_bsize; + sblk.b_bno = super / DEV_BSIZE; if (sblock.e2fs_ncg == 1) { /* no alternate superblock; assume it's okey */ |