Lines Matching refs:pmp
127 /* Byte offset in FAT on filesystem pmp, cluster cn */
128 #define FATOFS(pmp, cn) ((cn) * (pmp)->pm_fatmult / (pmp)->pm_fatdiv)
153 #define bptoep(pmp, bp, dirofs) \
155 + ((dirofs) & (pmp)->pm_crbomask)))
160 #define de_bn2cn(pmp, bn) \
161 ((bn) >> ((pmp)->pm_cnshift - (pmp)->pm_bnshift))
166 #define de_cn2bn(pmp, cn) \
167 ((cn) << ((pmp)->pm_cnshift - (pmp)->pm_bnshift))
172 #define de_cluster(pmp, off) \
173 ((off) >> (pmp)->pm_cnshift)
178 #define de_clcount(pmp, size) \
179 (((size) + (pmp)->pm_bpcluster - 1) >> (pmp)->pm_cnshift)
184 #define de_blk(pmp, off) \
185 (de_cn2bn(pmp, de_cluster((pmp), (off))))
190 #define de_cn2off(pmp, cn) \
191 ((cn) << (pmp)->pm_cnshift)
196 #define de_bn2off(pmp, bn) \
197 ((bn) << (pmp)->pm_bnshift)
201 #define cntobn(pmp, cn) \
202 (de_cn2bn((pmp), (cn)-CLUST_FIRST) + (pmp)->pm_firstcluster)
207 #define roottobn(pmp, dirofs) \
208 (de_blk((pmp), (dirofs)) + (pmp)->pm_rootdirblk)
214 #define detobn(pmp, dirclu, dirofs) \
216 ? roottobn((pmp), (dirofs)) \
217 : cntobn((pmp), (dirclu)))
223 #define MSDOSFS_LOCK_MP(pmp) \
224 lockmgr(&(pmp)->pm_fatlock, LK_EXCLUSIVE, NULL)
225 #define MSDOSFS_UNLOCK_MP(pmp) \
226 lockmgr(&(pmp)->pm_fatlock, LK_RELEASE, NULL)
227 #define MSDOSFS_ASSERT_MP_LOCKED(pmp) \
228 lockmgr_assert(&(pmp)->pm_fatlock, KA_XLOCKED)