From 39fbf175f3c3d2f6af075622e52b06c981b78656 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Fri, 8 Aug 2008 23:49:54 +0000 Subject: Admit b_blkno means block number; a block is DEV_BSIZE (a.k.a. 512) bytes; ffs is inextricably tied to using b_blkno and disklabel always uses sectorsize units. Thus use DEV_BSIZE units for all fields describing ffs filesystems and convert to/from sectors where required. This enables the creation and use of ffs filesystems on non-512 byte sectorsize devices. This diff allows i386 and sgi (the two test platforms) to find disklabels that are not on a sectorsize boundary. Same change to further archs coming. This is a no-op on 512-byte sectorsize devices. This work triggered by jsing@'s need to create ffs filesystems on sgi cdroms so we can create cdrom install media for sgi. sgi testing by jsing@ ok jsing@ pedro@ "looks sane" beck@ weingart@ --- sys/ufs/ffs/ffs_vfsops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/ufs/ffs/ffs_vfsops.c') diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 3f6af7c9954..926ec92d59d 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.115 2008/08/08 09:02:25 thib Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.116 2008/08/08 23:49:53 krw Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -554,7 +554,7 @@ ffs_reload(struct mount *mountp, struct ucred *cred, struct proc *p) fs = VFSTOUFS(mountp)->um_fs; - error = bread(devvp, (daddr64_t)(fs->fs_sblockloc / size), SBSIZE, + error = bread(devvp, (daddr64_t)(fs->fs_sblockloc / DEV_BSIZE), SBSIZE, NOCRED, &bp); if (error) { brelse(bp); @@ -716,7 +716,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) bp = NULL; } - error = bread(devvp, sbtry[i] / size, SBSIZE, cred, &bp); + error = bread(devvp, sbtry[i] / DEV_BSIZE, SBSIZE, cred, &bp); if (error) goto out; -- cgit v1.2.3