Fix '-b' option to work with the superblock locations output by newfs
authorkrw <krw@openbsd.org>
Fri, 9 May 2014 13:19:34 +0000 (13:19 +0000)
committerkrw <krw@openbsd.org>
Fri, 9 May 2014 13:19:34 +0000 (13:19 +0000)
commit17af71c173759db243fc6e8c16a0148fa5802a36
tree0cd5c0ca106a700340bbed76f556a2a485607f39
parent8638537d7ebcd65e3fab915c35f87640bc5c7327
Fix '-b' option to work with the superblock locations output by newfs
on 4096-byte sector disks. No-op on 512-byte sector disks.

Adhering to the bedrock idea that ffs will *never* use anything but
512-byte block disk addressing (a.k.a. daddr_t), and believing that
the 'fake' bread()/bwrite() functions should always be using 512-btye
block numbers like their kernel big brothers, nuke the computed
dev_bsize and use DEV_BSIZE for conversions to/from byte offsets.

Spotted and various fixes tested by David Vasek.

Still to fix: scanning for superblocks on 4K disks.

ok otto@
sbin/fsck_ffs/fsck.h
sbin/fsck_ffs/setup.c
sbin/fsck_ffs/utilities.c