Home | History | Annotate | Download | only in fsck_msdos

Lines Matching refs:next

138 checkclnum(struct bootblock *boot, int fat, cl_t cl, cl_t *next)
140 if (*next >= (CLUST_RSRVD&boot->ClustMask))
141 *next |= ~boot->ClustMask;
142 if (*next == CLUST_FREE) {
146 if (*next == CLUST_BAD) {
150 if (*next < CLUST_FIRST
151 || (*next >= boot->NumClusters && *next < CLUST_EOFS)) {
154 *next < CLUST_RSRVD ? "out of range" : "reserved",
155 *next&boot->ClustMask);
157 *next = CLUST_EOF;
289 fat[cl].next = p[0] + (p[1] << 8)
291 fat[cl].next &= boot->ClustMask;
292 ret |= checkclnum(boot, no, cl, &fat[cl].next);
297 fat[cl].next = p[0] + (p[1] << 8);
298 ret |= checkclnum(boot, no, cl, &fat[cl].next);
303 fat[cl].next = (p[0] + (p[1] << 8)) & 0x0fff;
304 ret |= checkclnum(boot, no, cl, &fat[cl].next);
308 fat[cl].next = ((p[1] >> 4) + (p[2] << 4)) & 0x0fff;
309 ret |= checkclnum(boot, no, cl, &fat[cl].next);
414 if (first[cl].next != second[cl].next)
415 ret |= clustdiffer(cl, &first[cl].next, &second[cl].next, fatnum);
427 q = fat[p].next;
428 fat[p].next = fat[p].head = CLUST_FREE;
461 /* find next untravelled chain */
463 || fat[head].next == CLUST_FREE
464 || fat[head].next == CLUST_BAD)
470 p = fat[p].next) {
482 fat[head].length = fat[head].next == CLUST_FREE ? 0 : len;
491 /* find next untravelled chain */
498 (n = fat[p].next) >= CLUST_FIRST && n < boot->NumClusters && wdk;
510 ret |= tryclear(boot, fat, head, &fat[p].next);
516 ret |= tryclear(boot, fat, head, &fat[p].next);
521 conf = tryclear(boot, fat, head, &fat[p].next);
529 p = fat[p].next) {
617 if (fat[cl].next == CLUST_FREE)
619 *p++ = (u_char)fat[cl].next;
620 *p++ = (u_char)(fat[cl].next >> 8);
621 *p++ = (u_char)(fat[cl].next >> 16);
623 *p++ |= (fat[cl].next >> 24)&0x0f;
626 if (fat[cl].next == CLUST_FREE)
628 *p++ = (u_char)fat[cl].next;
629 *p++ = (u_char)(fat[cl].next >> 8);
632 if (fat[cl].next == CLUST_FREE)
635 && fat[cl + 1].next == CLUST_FREE)
637 next;
638 *p++ = (u_char)((fat[cl].next >> 8) & 0xf)
639 |(u_char)(fat[cl+1].next << 4);
640 *p++ = (u_char)(fat[++cl].next >> 4);
668 /* find next untravelled chain */
670 || fat[head].next == CLUST_FREE
671 || (fat[head].next >= CLUST_RSRVD
672 && fat[head].next < CLUST_EOFS)
706 if ((boot->FSNext >= boot->NumClusters) || (fat[boot->FSNext].next != CLUST_FREE)) {
707 pwarn("Next free cluster in FSInfo block (%u) not free\n",
711 if (fat[head].next == CLUST_FREE) {
725 if (boot->NumFree && fat[boot->FSNext].next != CLUST_FREE) {
726 pwarn("Next free cluster in FSInfo block (%u) not free\n",
730 if (fat[head].next == CLUST_FREE) {