• Home
  • Raw
  • Download

Lines Matching refs:boot

170 	struct bootblock	*boot;  member
525 return (fat->boot); in boot_of_()
559 const struct bootblock *boot = boot_of_(fat); in valid_cl() local
561 return (cl >= CLUST_FIRST && cl < boot->NumClusters); in valid_cl()
582 checkdirty(int fs, struct bootblock *boot) in checkdirty() argument
589 if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK) in checkdirty()
592 off = boot->bpbResSectors; in checkdirty()
593 off *= boot->bpbBytesPerSec; in checkdirty()
595 buffer = malloc(len = boot->bpbBytesPerSec); in checkdirty()
606 if ((size_t)read(fs, buffer, boot->bpbBytesPerSec) != in checkdirty()
607 boot->bpbBytesPerSec) { in checkdirty()
616 if (buffer[0] != boot->bpbMedia || buffer[1] != 0xff) in checkdirty()
618 if (boot->ClustMask == CLUST16_MASK) { in checkdirty()
631 if (boot->ClustMask == CLUST16_MASK) { in checkdirty()
648 struct bootblock *boot; in cleardirty() local
653 boot = boot_of_(fat); in cleardirty()
656 if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK) in cleardirty()
659 off = boot->bpbResSectors; in cleardirty()
660 off *= boot->bpbBytesPerSec; in cleardirty()
662 buffer = malloc(len = boot->bpbBytesPerSec); in cleardirty()
673 if (boot->ClustMask == CLUST16_MASK) { in cleardirty()
701 struct bootblock *boot; in _readfat() local
704 boot = boot_of_(fat); in _readfat()
706 fat->fatsize = boot->FATsecs * boot->bpbBytesPerSec; in _readfat()
708 off = boot->bpbResSectors; in _readfat()
709 off *= boot->bpbBytesPerSec; in _readfat()
734 if (boot->ClustMask == CLUST32_MASK && in _readfat()
739 fat->fat32_offset = boot->bpbResSectors * boot->bpbBytesPerSec; in _readfat()
808 readfat(int fs, struct bootblock *boot, struct fat_descriptor **fp) in readfat() argument
815 boot->NumFree = boot->NumBad = 0; in readfat()
824 fat->boot = boot; in readfat()
833 switch(boot->ClustMask) { in readfat()
852 pfatal("Invalid ClustMask: %d", boot->ClustMask); in readfat()
858 if (bitmap_ctor(&fat->headbitmap, boot->NumClusters, in readfat()
861 (size_t)boot->NumClusters); in readfat()
867 if (buffer[0] != boot->bpbMedia in readfat()
869 || (boot->ClustMask == CLUST16_MASK && buffer[3] != 0xff) in readfat()
870 || (boot->ClustMask == CLUST32_MASK in readfat()
881 if (buffer[0] == boot->bpbMedia && buffer[1] == 0xff in readfat()
883 && ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f) in readfat()
884 || (boot->ClustMask == CLUST32_MASK in readfat()
892 switch (boot->ClustMask) { in readfat()
915 *p++ = (u_char)boot->bpbMedia; in readfat()
918 switch (boot->ClustMask) { in readfat()
966 for (cl = CLUST_FIRST; cl < boot->NumClusters; cl++) { in readfat()
972 if (boot->FSNext == 0) { in readfat()
973 boot->FSNext = cl; in readfat()
978 boot->NumFree++; in readfat()
983 boot->NumBad++; in readfat()
988 nextcl & boot->ClustMask); in readfat()
1125 struct bootblock *boot = boot_of_(fat); in clearchain() local
1132 boot->NumFree++; in clearchain()
1146 struct bootblock *boot; in copyfat() local
1151 boot = boot_of_(fat); in copyfat()
1161 dst_off = boot->bpbResSectors + n * boot->FATsecs; in copyfat()
1162 dst_off *= boot->bpbBytesPerSec; in copyfat()
1196 struct bootblock *boot; in writefat() local
1199 boot = boot_of_(fat); in writefat()
1221 for (i = 1; i < boot->bpbFATs; i++) { in writefat()
1228 for (i = fat->is_mmapped ? 1 : 0; i < boot->bpbFATs; i++) { in writefat()
1229 dst_base = boot->bpbResSectors + i * boot->FATsecs; in writefat()
1230 dst_base *= boot->bpbBytesPerSec; in writefat()
1253 struct bootblock *boot; in checklost() local
1256 boot = boot_of_(fat); in checklost()
1265 chains > 0 && head < boot->NumClusters; in checklost()
1298 if (boot->bpbFSInfo) { in checklost()
1300 if (boot->FSFree != 0xffffffffU && in checklost()
1301 boot->FSFree != boot->NumFree) { in checklost()
1303 boot->FSFree, boot->NumFree); in checklost()
1305 boot->FSFree = boot->NumFree; in checklost()
1309 if (boot->FSNext != 0xffffffffU && in checklost()
1310 (boot->FSNext >= boot->NumClusters || in checklost()
1311 (boot->NumFree && fat_get_cl_next(fat, boot->FSNext) != CLUST_FREE))) { in checklost()
1313 boot->FSNext, in checklost()
1314 (boot->FSNext >= boot->NumClusters) ? "invalid" : "not free"); in checklost()
1316 for (head = CLUST_FIRST; head < boot->NumClusters; head++) in checklost()
1318 boot->FSNext = head; in checklost()
1324 mod |= writefsinfo(dosfs, boot); in checklost()