From 5319a398801f23368225691f44bf07b096eb5e86 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 16 Dec 2006 12:44:06 +0000 Subject: Adopt FreeBSD's code for non-DEV_BSIZE formatted MSDOSFS filesystems. Enables devices (e.g. newer iPods, various other mp3 players) that use 2048 byte sectors. Inspired by original diffs from weingart@ and Alexey Vatchenk. ok tom@ pedro@ deraadt@ weingart@ marco@ --- sys/msdosfs/msdosfsmount.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/msdosfs/msdosfsmount.h') diff --git a/sys/msdosfs/msdosfsmount.h b/sys/msdosfs/msdosfsmount.h index 56f2cd971ff..45f72016fde 100644 --- a/sys/msdosfs/msdosfsmount.h +++ b/sys/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfsmount.h,v 1.17 2006/12/15 03:04:24 krw Exp $ */ +/* $OpenBSD: msdosfsmount.h,v 1.18 2006/12/16 12:44:05 krw Exp $ */ /* $NetBSD: msdosfsmount.h,v 1.16 1997/10/17 11:24:24 ws Exp $ */ /*- @@ -59,6 +59,7 @@ struct msdosfsmount { mode_t pm_mask; /* mask to and with file protection bits */ struct vnode *pm_devvp; /* vnode for block device mntd */ struct bpb50 pm_bpb; /* BIOS parameter blk for this fs */ + uint32_t pm_BlkPerSec; /* # of DEV_BSIZE blocks in MSDOSFS sector */ uint32_t pm_FATsecs; /* actual number of fat sectors */ uint32_t pm_fatblk; /* block # of first FAT */ uint32_t pm_rootdirblk; /* block # (cluster # for FAT32) of root directory number */ @@ -195,6 +196,10 @@ struct msdosfsmount { ? roottobn((pmp), (dirofs)) \ : cntobn((pmp), (dirclu))) +/* Calculate size of fsinfo block */ +#define fsi_size(pmp) \ + (1024 << ((pmp)->pm_BlkPerSec >> 2)) + /* * Prototypes for MSDOSFS virtual filesystem operations */ -- cgit v1.2.3