Lines Matching refs:head

420 clearchain(struct bootblock *boot, struct fatEntry *fat, cl_t head)  in clearchain()  argument
424 for (p = head; p >= CLUST_FIRST && p < boot->NumClusters; p = q) { in clearchain()
425 if (fat[p].head != head) in clearchain()
428 fat[p].next = fat[p].head = CLUST_FREE; in clearchain()
434 tryclear(struct bootblock *boot, struct fatEntry *fat, cl_t head, cl_t *trunc) in tryclear() argument
436 if (ask(1, "Clear chain starting at %u", head)) { in tryclear()
437 clearchain(boot, fat, head); in tryclear()
452 cl_t head, p, h, n, wdk; in checkfat() local
460 for (head = CLUST_FIRST; head < boot->NumClusters; head++) { in checkfat()
462 if (fat[head].head != 0 /* cluster already belongs to some chain */ in checkfat()
463 || fat[head].next == CLUST_FREE in checkfat()
464 || fat[head].next == CLUST_BAD) in checkfat()
468 for (len = 0, p = head; in checkfat()
473 printf("detect cluster chain loop: head %u for p %u\n", head, p); in checkfat()
477 fat[p].head = head; in checkfat()
482 fat[head].length = fat[head].next == CLUST_FREE ? 0 : len; in checkfat()
490 for (head = CLUST_FIRST; head < boot->NumClusters; head++) { in checkfat()
492 if (fat[head].head != head) in checkfat()
497 for (p = head,wdk=boot->NumClusters; in checkfat()
500 if (fat[n].head != head) in checkfat()
509 head, rsrvdcltype(n)); in checkfat()
510 ret |= tryclear(boot, fat, head, &fat[p].next); in checkfat()
515 head, n); in checkfat()
516 ret |= tryclear(boot, fat, head, &fat[p].next); in checkfat()
520 head, fat[n].head, n); in checkfat()
521 conf = tryclear(boot, fat, head, &fat[p].next); in checkfat()
522 if (ask(1, "Clear chain starting at %u", h = fat[n].head)) { in checkfat()
530 if (h != fat[p].head) { in checkfat()
534 head--; in checkfat()
537 fat[p].head = head; in checkfat()
663 cl_t head; in checklost() local
667 for (head = CLUST_FIRST; head < boot->NumClusters; head++) { in checklost()
669 if (fat[head].head != head in checklost()
670 || fat[head].next == CLUST_FREE in checklost()
671 || (fat[head].next >= CLUST_RSRVD in checklost()
672 && fat[head].next < CLUST_EOFS) in checklost()
673 || (fat[head].flags & FAT_USED)) in checklost()
677 head, fat[head].length); in checklost()
678 mod |= ret = reconnect(dosfs, boot, fat, head); in checklost()
683 clearchain(boot, fat, head); in checklost()
688 clearchain(boot, fat, head); in checklost()
710 for (head = CLUST_FIRST; head < boot->NumClusters; head++) in checklost()
711 if (fat[head].next == CLUST_FREE) { in checklost()
712 boot->FSNext = head; in checklost()
729 for (head = CLUST_FIRST; head < boot->NumClusters; head++) in checklost()
730 if (fat[head].next == CLUST_FREE) { in checklost()
731 boot->FSNext = head; in checklost()