Lines Matching refs:fat
72 #define RESFTE 2 /* reserved FAT entries */
80 #define mincls(fat) ((fat) == 12 ? MINCLS12 : \
81 (fat) == 16 ? MINCLS16 : \
84 #define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \
85 (fat) == 16 ? MAXCLS16 : \
119 u_int8_t spf[2]; /* sectors per FAT */
127 u_int8_t bspf[4]; /* big sectors per FAT */
128 u_int8_t xflg[2]; /* FAT control flags */
163 u_int spf; /* sectors per FAT */
168 u_int bspf; /* big sectors per FAT */
271 u_int fat, bss, rds, cls, dir, lsn, x, x1, x2;
293 errx(1, "%s: bad FAT type", optarg);
314 opt_a = argto4(optarg, 1, "sectors/FAT");
446 if (!(fat = opt_F)) {
448 fat = 12;
450 fat = 32;
452 if ((fat == 32 && opt_e) || (fat != 32 && (opt_i || opt_k)))
453 errx(1, "-%c is not a legal FAT%s option",
454 fat == 32 ? 'e' : opt_i ? 'i' : 'k',
455 fat == 32 ? "32" : "12/16");
456 if (opt_f && fat == 32)
514 if (!fat) {
523 fat = 12;
530 fat = 16;
532 fat = 32;
535 if (fat == 32) {
553 bpb.res = fat == 32 ? MAX(x, MAX(16384 / bpb.bps, 4)) : x;
556 if (fat != 32 && !bpb.rde)
560 for (bpb.spc = howmany(fat == 16 ? DEFBLK16 : DEFBLK, bpb.bps);
563 howmany((RESFTE + maxcls(fat)) * (fat / BPN),
566 (u_int64_t)(maxcls(fat) + 1) * bpb.spc <= bpb.bsec;
568 if (fat != 32 && bpb.bspf > MAXU16)
569 errx(1, "too many sectors/FAT for FAT12/16");
576 (bpb.spc * bpb.bps * NPB + fat / BPN * bpb.nft);
577 x2 = howmany((RESFTE + MIN(x, maxcls(fat))) * (fat / BPN),
584 x = (u_int64_t)bpb.bspf * bpb.bps * NPB / (fat / BPN) - RESFTE;
588 warnx("warning: sectors/FAT limits file system to %u clusters",
590 if (cls < mincls(fat))
591 errx(1, "%u clusters too few clusters for FAT%u, need %u", cls, fat,
592 mincls(fat));
593 if (cls > maxcls(fat)) {
594 cls = maxcls(fat);
596 warnx("warning: FAT type limits file system to %u sectors",
599 printf("%s: %u sector%s in %u FAT%u cluster%s "
601 cls * bpb.spc == 1 ? "" : "s", cls, fat,
605 if (fat == 32)
611 if (fat != 32) {
623 for (lsn = 0; lsn < dir + (fat == 32 ? bpb.spc : rds); lsn++) {
626 fat == 32 && bpb.bkbs != MAXU16 &&
640 (fat == 32 && bpb.bkbs != MAXU16 && lsn == bpb.bkbs)) {
656 if (fat == 32) {
680 sprintf(buf, "FAT%u", fat);
693 } else if (fat == 32 && bpb.infs != MAXU16 &&
706 for (x = 1; x < fat * (fat == 32 ? 3 : 2) / 8; x++)
707 mk1(img[x], fat == 32 && x % 4 == 3 ? 0x0f : 0xff);
1065 "\t-F FAT type (12, 16, or 32)\n"
1071 "\t-a sectors/FAT\n"