From owner-freebsd-current Sun Sep 27 21:14:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA25064 for freebsd-current-outgoing; Sun, 27 Sep 1998 21:14:14 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA25027 for ; Sun, 27 Sep 1998 21:14:04 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id OAA08286; Mon, 28 Sep 1998 14:13:42 +1000 Date: Mon, 28 Sep 1998 14:13:42 +1000 From: Bruce Evans Message-Id: <199809280413.OAA08286@godzilla.zeta.org.au> To: mike@smith.net.au, tmb@rcru.rl.ac.uk Subject: Re: 2048-byte sector support for DOS filesystem. Cc: freebsd-current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >As Bruce pointed out, the only thing 'msdosfs' doesn't use an >arbitrary sector size for is reading the boot sector. i.e. > >/* $Id: msdosfs_vfsops.c,v 1.36 1998/09/07 13:17:02 bde Exp $ */ >/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ >[intervening bits deleted ] > /* > * Read the boot sector of the filesystem, and then check the > * boot signature. If not a dos boot sector then error out. > */ >#ifdef PC98 > error = bread(devvp, 0, 1024, NOCRED, &bp); >#else > error = bread(devvp, 0, 512, NOCRED, &bp); >#endif > >After reading the code, I realized that the physical sector >block size is currently only available *after* the boot sector >is read, so I'm not really sure what the answer is. Presumably >the sector size is available from some other low-level bit of >SCSI/CAM code, but I'm not sure what the appropriate way to get at >it is. > >Any suggestions? (a) Always use 2048 or larger. (b) Get the sector size using the DIOCGPART ioctl(). Using ioctls in the kernel is a kludge, but other mount routines already use this ioctl precisely to get the sector size. See ffs_mountfs(). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message