Date: Mon, 28 Sep 1998 14:13:42 +1000 From: Bruce Evans <bde@zeta.org.au> To: mike@smith.net.au, tmb@rcru.rl.ac.uk Cc: freebsd-current@FreeBSD.ORG Subject: Re: 2048-byte sector support for DOS filesystem. Message-ID: <199809280413.OAA08286@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809280413.OAA08286>