summaryrefslogtreecommitdiff
path: root/sys/msdosfs/msdosfsmount.h
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-12-16 12:44:06 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-12-16 12:44:06 +0000
commit5319a398801f23368225691f44bf07b096eb5e86 (patch)
treeb860cff86b48bf04c8d915f8eb3cb074042ba73e /sys/msdosfs/msdosfsmount.h
parent474330739d2effcf5f82056b412155be23b391fb (diff)
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@
Diffstat (limited to 'sys/msdosfs/msdosfsmount.h')
-rw-r--r--sys/msdosfs/msdosfsmount.h7
1 files changed, 6 insertions, 1 deletions
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
*/