Lines Matching refs:next
45 checkclnum(struct bootblock *boot, int fat, cl_t cl, cl_t *next) in checkclnum() argument
47 if (*next >= (CLUST_RSRVD&boot->ClustMask)) in checkclnum()
48 *next |= ~boot->ClustMask; in checkclnum()
49 if (*next == CLUST_FREE) { in checkclnum()
53 if (*next == CLUST_BAD) { in checkclnum()
57 if (*next < CLUST_FIRST in checkclnum()
58 || (*next >= boot->NumClusters && *next < CLUST_EOFS)) { in checkclnum()
61 *next < CLUST_RSRVD ? "out of range" : "reserved", in checkclnum()
62 *next&boot->ClustMask); in checkclnum()
64 *next = CLUST_EOF; in checkclnum()
153 fat[cl].next = p[0] + (p[1] << 8) in readfat()
155 fat[cl].next &= boot->ClustMask; in readfat()
156 ret |= checkclnum(boot, no, cl, &fat[cl].next); in readfat()
161 fat[cl].next = p[0] + (p[1] << 8); in readfat()
162 ret |= checkclnum(boot, no, cl, &fat[cl].next); in readfat()
167 fat[cl].next = (p[0] + (p[1] << 8)) & 0x0fff; in readfat()
168 ret |= checkclnum(boot, no, cl, &fat[cl].next); in readfat()
172 fat[cl].next = ((p[1] >> 4) + (p[2] << 4)) & 0x0fff; in readfat()
173 ret |= checkclnum(boot, no, cl, &fat[cl].next); in readfat()
282 if (first[cl].next != second[cl].next) in comparefat()
283 ret |= clustdiffer(cl, &first[cl].next, &second[cl].next, fatnum); in comparefat()
295 q = fat[p].next; in clearchain()
296 fat[p].next = fat[p].head = CLUST_FREE; in clearchain()
314 p = fat[p].next) { in tryclear()
340 || fat[head].next == CLUST_FREE in checkfat()
341 || fat[head].next == CLUST_BAD) in checkfat()
348 p = fat[p].next) { in checkfat()
354 fat[head].length = fat[head].next == CLUST_FREE ? 0 : len; in checkfat()
369 (n = fat[p].next) >= CLUST_FIRST && n < boot->NumClusters; in checkfat()
381 ret |= tryclear(boot, fat, head, &fat[p].next); in checkfat()
387 ret |= tryclear(boot, fat, head, &fat[p].next); in checkfat()
393 ret |= tryclear(boot, fat, head, &fat[p].next); in checkfat()
398 conf = tryclear(boot, fat, head, &fat[p].next); in checkfat()
406 p = fat[p].next) { in checkfat()
466 if (fat[cl].next == CLUST_FREE) in writefat()
468 *p++ = (u_char)fat[cl].next; in writefat()
469 *p++ = (u_char)(fat[cl].next >> 8); in writefat()
470 *p++ = (u_char)(fat[cl].next >> 16); in writefat()
472 *p++ |= (fat[cl].next >> 24)&0x0f; in writefat()
475 if (fat[cl].next == CLUST_FREE) in writefat()
477 *p++ = (u_char)fat[cl].next; in writefat()
478 *p++ = (u_char)(fat[cl].next >> 8); in writefat()
481 if (fat[cl].next == CLUST_FREE) in writefat()
483 *p++ = (u_char)fat[cl].next; in writefat()
484 *p = (u_char)((fat[cl].next >> 8) & 0xf); in writefat()
488 if (fat[cl].next == CLUST_FREE) in writefat()
490 *p++ |= (u_char)(fat[cl].next << 4); in writefat()
491 *p++ = (u_char)(fat[cl].next >> 4); in writefat()
521 || fat[head].next == CLUST_FREE in checklost()
522 || (fat[head].next >= CLUST_RSRVD in checklost()
523 && fat[head].next < CLUST_EOFS) in checklost()
552 fat[boot->FSNext].next != CLUST_FREE)) { in checklost()
557 if (fat[head].next == CLUST_FREE) { in checklost()