Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/msdosfs/msdosfsmount.h
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | struct msdosfsmount { | ||||
u_long pm_fatblocksec; /* size of FAT blocks in sectors */ | u_long pm_fatblocksec; /* size of FAT blocks in sectors */ | ||||
u_long pm_fatsize; /* size of FAT in bytes */ | u_long pm_fatsize; /* size of FAT in bytes */ | ||||
uint32_t pm_fatmask; /* mask to use for FAT numbers */ | uint32_t pm_fatmask; /* mask to use for FAT numbers */ | ||||
u_long pm_fsinfo; /* fsinfo block number */ | u_long pm_fsinfo; /* fsinfo block number */ | ||||
u_long pm_nxtfree; /* next place to search for a free cluster */ | u_long pm_nxtfree; /* next place to search for a free cluster */ | ||||
u_int pm_fatmult; /* these 2 values are used in FAT */ | u_int pm_fatmult; /* these 2 values are used in FAT */ | ||||
u_int pm_fatdiv; /* offset computation */ | u_int pm_fatdiv; /* offset computation */ | ||||
u_int pm_curfat; /* current FAT for FAT32 (0 otherwise) */ | u_int pm_curfat; /* current FAT for FAT32 (0 otherwise) */ | ||||
int pm_rootdirfree; /* number of free slots in FAT12/16 root directory */ | |||||
u_int *pm_inusemap; /* ptr to bitmap of in-use clusters */ | u_int *pm_inusemap; /* ptr to bitmap of in-use clusters */ | ||||
uint64_t pm_flags; /* see below */ | uint64_t pm_flags; /* see below */ | ||||
void *pm_u2w; /* Local->Unicode iconv handle */ | void *pm_u2w; /* Local->Unicode iconv handle */ | ||||
void *pm_w2u; /* Unicode->Local iconv handle */ | void *pm_w2u; /* Unicode->Local iconv handle */ | ||||
void *pm_u2d; /* Unicode->DOS iconv handle */ | void *pm_u2d; /* Unicode->DOS iconv handle */ | ||||
void *pm_d2u; /* DOS->Local iconv handle */ | void *pm_d2u; /* DOS->Local iconv handle */ | ||||
#ifndef MAKEFS | #ifndef MAKEFS | ||||
se: This could also be an int or u:_int. The acceptable range is 0..65535. | |||||
Done Inline ActionsThe type of pm_rootdirfree should be int to allow -1 to be returned as an error indicator. se: The type of pm_rootdirfree should be int to allow -1 to be returned as an error indicator. | |||||
struct lock pm_fatlock; /* lockmgr protecting allocations */ | struct lock pm_fatlock; /* lockmgr protecting allocations */ | ||||
struct lock pm_checkpath_lock; /* protects doscheckpath result */ | struct lock pm_checkpath_lock; /* protects doscheckpath result */ | ||||
struct task pm_rw2ro_task; /* context for emergency remount ro */ | struct task pm_rw2ro_task; /* context for emergency remount ro */ | ||||
#endif | #endif | ||||
}; | }; | ||||
/* | /* | ||||
* A 64-bit file number and the 32-bit file number to which it is mapped, | * A 64-bit file number and the 32-bit file number to which it is mapped, | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Calculate block number for directory entry at cluster dirclu, offset | * Calculate block number for directory entry at cluster dirclu, offset | ||||
* dirofs | * dirofs | ||||
*/ | */ | ||||
#define detobn(pmp, dirclu, dirofs) \ | #define detobn(pmp, dirclu, dirofs) \ | ||||
((dirclu) == MSDOSFSROOT \ | ((dirclu) == MSDOSFSROOT \ | ||||
? roottobn((pmp), (dirofs)) \ | ? roottobn((pmp), (dirofs)) \ | ||||
: cntobn((pmp), (dirclu))) | : cntobn((pmp), (dirclu))) | ||||
/* | |||||
Done Inline ActionsThe comment is wrong and applies to a prior version of the patch: the number of free entries is counted (here and in the macro below), se: The comment is wrong and applies to a prior version of the patch: the number of free entries is… | |||||
Done Inline ActionsThe comment needs to be fixed - has been forgotten when I prepared the latest patch. se: The comment needs to be fixed - has been forgotten when I prepared the latest patch. | |||||
* Increment the number of used entries in a fixed size FAT12/16 root | |||||
* directory | |||||
*/ | |||||
#define rootde_alloced(dep) \ | |||||
if ((dep)->de_StartCluster == MSDOSFSROOT) \ | |||||
(dep)->de_pmp->pm_rootdirfree--; | |||||
/* | |||||
* Decrement the number of used entries in a fixed size FAT12/16 root | |||||
* directory | |||||
*/ | |||||
#define rootde_freed(dep) \ | |||||
if ((dep)->de_StartCluster == MSDOSFSROOT) \ | |||||
(dep)->de_pmp->pm_rootdirfree++; | |||||
#define MSDOSFS_LOCK_MP(pmp) \ | #define MSDOSFS_LOCK_MP(pmp) \ | ||||
lockmgr(&(pmp)->pm_fatlock, LK_EXCLUSIVE, NULL) | lockmgr(&(pmp)->pm_fatlock, LK_EXCLUSIVE, NULL) | ||||
#define MSDOSFS_UNLOCK_MP(pmp) \ | #define MSDOSFS_UNLOCK_MP(pmp) \ | ||||
lockmgr(&(pmp)->pm_fatlock, LK_RELEASE, NULL) | lockmgr(&(pmp)->pm_fatlock, LK_RELEASE, NULL) | ||||
#define MSDOSFS_ASSERT_MP_LOCKED(pmp) \ | #define MSDOSFS_ASSERT_MP_LOCKED(pmp) \ | ||||
lockmgr_assert(&(pmp)->pm_fatlock, KA_XLOCKED) | lockmgr_assert(&(pmp)->pm_fatlock, KA_XLOCKED) | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
This could also be an int or u:_int. The acceptable range is 0..65535.