Home | History | Annotate | Download | only in fsck_msdos

Lines Matching full:boot

224 resetDosDirSection(struct bootblock *boot, struct fatEntry *fat)
230 b1 = boot->RootDirEnts * 32;
231 b2 = boot->SecPerClust * boot->BytesPerSec;
240 if (boot->flags & FAT32) {
241 if (boot->RootCl < CLUST_FIRST || boot->RootCl >= boot->NumClusters) {
243 boot->RootCl);
246 cl = fat[boot->RootCl].next;
249 || fat[boot->RootCl].head != boot->RootCl) {
260 fat[boot->RootCl].next = CLUST_FREE;
266 fat[boot->RootCl].flags |= FAT_USED;
267 rootDir->head = boot->RootCl;
307 delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl,
312 int clsz = boot->SecPerClust * boot->BytesPerSec;
316 while (startcl >= CLUST_FIRST && startcl < boot->NumClusters) {
322 off = startcl * boot->SecPerClust + boot->ClusterOffset;
323 off *= boot->BytesPerSec;
355 removede(int f, struct bootblock *boot, struct fatEntry *fat, u_char *start,
371 if (delete(f, boot, fat,
390 checksize(struct bootblock *boot, struct fatEntry *fat, u_char *p,
401 if (dir->head < CLUST_FIRST || dir->head >= boot->NumClusters)
403 physicalSize = fat[dir->head].length * boot->ClusterSize;
417 } else if (physicalSize - dir->size >= boot->ClusterSize) {
424 for (cl = dir->head; (sz += boot->ClusterSize) < dir->size;)
426 clearchain(boot, fat, fat[cl].next);
443 check_dot_dot(int f, struct bootblock *boot, struct fatEntry *fat,struct dosDirEntry *dir)
455 if (dir->parent && (cl < CLUST_FIRST || cl >= boot->NumClusters)) {
460 if (!(boot->flags & FAT32) && !dir->parent) {
461 last = boot->RootDirEnts * 32;
462 off = boot->ResSectors + boot->FATs * boot->FATsecs;
464 last = boot->SecPerClust * boot->BytesPerSec;
465 off = cl * boot->SecPerClust + boot->ClusterOffset;
468 off *= boot->BytesPerSec;
503 } while ((cl = fat[cl].next) >= CLUST_FIRST && cl < boot->NumClusters);
523 readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat,
540 if (dir->parent && (cl < CLUST_FIRST || cl >= boot->NumClusters)) {
552 if (!(boot->flags & FAT32) && !dir->parent) {
553 last = boot->RootDirEnts * 32;
554 off = boot->ResSectors + boot->FATs * boot->FATsecs;
556 last = boot->SecPerClust * boot->BytesPerSec;
557 off = cl * boot->SecPerClust + boot->ClusterOffset;
560 off *= boot->BytesPerSec;
594 if (delete(f, boot, fat,
712 mod |= removede(f, boot, fat,
738 if (boot->ClustMask == CLUST32_MASK)
751 mod |= k = removede(f, boot, fat,
773 if (boot->ClustMask == CLUST32_MASK)
775 clearchain(boot, fat, dirent.head);
789 || dirent.head >= boot->NumClusters
798 || dirent.head >= boot->NumClusters)
823 if (boot->ClustMask == CLUST32_MASK)
832 if (dirent.head >= CLUST_FIRST && dirent.head < boot->NumClusters)
862 if (boot->ClustMask == CLUST32_MASK) {
880 if (boot->ClustMask == CLUST32_MASK)
893 if (boot->ClustMask == CLUST32_MASK) {
919 if (check_dot_dot(f,boot,fat,&dirent)) {
951 mod |= k = checksize(boot, fat, p, &dirent);
955 boot->NumFiles++;
966 } while ((cl = fat[cl].next) >= CLUST_FIRST && cl < boot->NumClusters);
968 mod |= removede(f, boot, fat,
976 handleDirTree(int dosfs, struct bootblock *boot, struct fatEntry *fat)
980 mod = readDosDirSection(dosfs, boot, fat, rootDir);
1001 mod |= readDosDirSection(dosfs, boot, fat, dir);
1017 reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
1036 lfbuf = malloc(boot->ClusterSize);
1046 for (; p < lfbuf + boot->ClusterSize; p += 32)
1050 if (p && p < lfbuf + boot->ClusterSize)
1053 if (lfcl < CLUST_FIRST || lfcl >= boot->NumClusters) {
1056 lfcl = (lostDir->head < boot->NumClusters) ? lostDir->head : 0;
1059 lfoff = lfcl * boot->ClusterSize
1060 + boot->ClusterOffset * boot->BytesPerSec;
1062 || read(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) {
1069 boot->NumFiles++;
1075 d.size = fat[head].length * boot->ClusterSize;
1082 if (boot->ClustMask == CLUST32_MASK) {
1092 || write(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) {