Lines Matching full:boot

168 	struct bootblock	*boot;  member
523 return (fat->boot); in boot_of_()
557 const struct bootblock *boot = boot_of_(fat); in valid_cl() local
559 return (cl >= CLUST_FIRST && cl < boot->NumClusters); in valid_cl()
580 checkdirty(int fs, struct bootblock *boot) in checkdirty() argument
587 if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK) in checkdirty()
590 off = boot->bpbResSectors; in checkdirty()
591 off *= boot->bpbBytesPerSec; in checkdirty()
593 buffer = malloc(len = boot->bpbBytesPerSec); in checkdirty()
604 if ((size_t)read(fs, buffer, boot->bpbBytesPerSec) != in checkdirty()
605 boot->bpbBytesPerSec) { in checkdirty()
614 if (buffer[0] != boot->bpbMedia || buffer[1] != 0xff) in checkdirty()
616 if (boot->ClustMask == CLUST16_MASK) { in checkdirty()
629 if (boot->ClustMask == CLUST16_MASK) { in checkdirty()
646 struct bootblock *boot; in cleardirty() local
651 boot = boot_of_(fat); in cleardirty()
654 if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK) in cleardirty()
657 off = boot->bpbResSectors; in cleardirty()
658 off *= boot->bpbBytesPerSec; in cleardirty()
660 buffer = malloc(len = boot->bpbBytesPerSec); in cleardirty()
671 if (boot->ClustMask == CLUST16_MASK) { in cleardirty()
699 struct bootblock *boot; in _readfat() local
702 boot = boot_of_(fat); in _readfat()
704 fat->fatsize = boot->FATsecs * boot->bpbBytesPerSec; in _readfat()
706 off = boot->bpbResSectors; in _readfat()
707 off *= boot->bpbBytesPerSec; in _readfat()
732 if (boot->ClustMask == CLUST32_MASK && in _readfat()
737 fat->fat32_offset = boot->bpbResSectors * boot->bpbBytesPerSec; in _readfat()
806 readfat(int fs, struct bootblock *boot, struct fat_descriptor **fp) in readfat() argument
813 boot->NumFree = boot->NumBad = 0; in readfat()
822 fat->boot = boot; in readfat()
831 switch(boot->ClustMask) { in readfat()
850 pfatal("Invalid ClustMask: %d", boot->ClustMask); in readfat()
856 if (bitmap_ctor(&fat->headbitmap, boot->NumClusters, in readfat()
859 (size_t)boot->NumClusters); in readfat()
865 if (buffer[0] != boot->bpbMedia in readfat()
867 || (boot->ClustMask == CLUST16_MASK && buffer[3] != 0xff) in readfat()
868 || (boot->ClustMask == CLUST32_MASK in readfat()
875 * 0xXXffff0fffffff07 for FAT32 upon boot, to know that the in readfat()
879 if (buffer[0] == boot->bpbMedia && buffer[1] == 0xff in readfat()
881 && ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f) in readfat()
882 || (boot->ClustMask == CLUST32_MASK in readfat()
890 switch (boot->ClustMask) { in readfat()
913 *p++ = (u_char)boot->bpbMedia; in readfat()
916 switch (boot->ClustMask) { in readfat()
964 for (cl = CLUST_FIRST; cl < boot->NumClusters; cl++) { in readfat()
970 if (boot->FSNext == 0) { in readfat()
971 boot->FSNext = cl; in readfat()
976 boot->NumFree++; in readfat()
981 boot->NumBad++; in readfat()
986 nextcl & boot->ClustMask); in readfat()
1123 struct bootblock *boot = boot_of_(fat); in clearchain() local
1130 boot->NumFree++; in clearchain()
1144 struct bootblock *boot; in copyfat() local
1149 boot = boot_of_(fat); in copyfat()
1159 dst_off = boot->bpbResSectors + n * boot->FATsecs; in copyfat()
1160 dst_off *= boot->bpbBytesPerSec; in copyfat()
1194 struct bootblock *boot; in writefat() local
1197 boot = boot_of_(fat); in writefat()
1219 for (i = 1; i < boot->bpbFATs; i++) { in writefat()
1226 for (i = fat->is_mmapped ? 1 : 0; i < boot->bpbFATs; i++) { in writefat()
1227 dst_base = boot->bpbResSectors + i * boot->FATsecs; in writefat()
1228 dst_base *= boot->bpbBytesPerSec; in writefat()
1251 struct bootblock *boot; in checklost() local
1254 boot = boot_of_(fat); in checklost()
1263 chains > 0 && head < boot->NumClusters; in checklost()
1296 if (boot->bpbFSInfo) { in checklost()
1298 if (boot->FSFree != 0xffffffffU && in checklost()
1299 boot->FSFree != boot->NumFree) { in checklost()
1301 boot->FSFree, boot->NumFree); in checklost()
1303 boot->FSFree = boot->NumFree; in checklost()
1307 if (boot->FSNext != 0xffffffffU && in checklost()
1308 (boot->FSNext >= boot->NumClusters || in checklost()
1309 (boot->NumFree && fat_get_cl_next(fat, boot->FSNext) != CLUST_FREE))) { in checklost()
1311 boot->FSNext, in checklost()
1312 (boot->FSNext >= boot->NumClusters) ? "invalid" : "not free"); in checklost()
1314 for (head = CLUST_FIRST; head < boot->NumClusters; head++) in checklost()
1316 boot->FSNext = head; in checklost()
1322 mod |= writefsinfo(dosfs, boot); in checklost()