Lines Matching defs:dir
34 __RCSID("$NetBSD: dir.c,v 1.20 2006/06/05 16:51:18 christos Exp $");
90 /* dir.c */
162 fullpath(struct dosDirEntry *dir)
172 np = dir->lname[0] ? dir->lname : dir->name;
180 dir = dir->parent;
181 if (!dir)
386 checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir)
398 if (dir->head == CLUST_FREE) {
401 if (!fat_is_valid_cl(fat, dir->head))
403 ret = checkchain(fat, dir->head, &chainsize);
422 if (physicalSize < dir->size) {
424 fullpath(dir), dir->size, (uintmax_t)physicalSize);
426 dir->size = physicalSize;
434 } else if (physicalSize - dir->size >= boot->ClusterSize) {
436 fullpath(dir));
441 for (cl = dir->head, len = sz = 0;
442 (sz += boot->ClusterSize) < dir->size; len++)
462 check_subdirectory(struct fat_descriptor *fat, struct dosDirEntry *dir)
474 cl = dir->head;
475 if (dir->parent && !fat_is_valid_cl(fat, cl)) {
479 if (!(boot->flags & FAT32) && !dir->parent) {
513 pwarn("%s: Incorrect `.' for %s.\n", __func__, dir->name);
519 pwarn("%s: Incorrect `..' for %s. \n", __func__, dir->name);
534 readDosDirSection(struct fat_descriptor *fat, struct dosDirEntry *dir)
553 cl = dir->head;
554 if (dir->parent && (!fat_is_valid_cl(fat, cl))) {
572 is_legacyroot = (dir->parent == NULL && !(boot->flags & FAT32));
579 mod |= checkchain(fat, dir->head, &dirclusters);
606 if (dir->fsckflags & DIREMPWARN) {
613 dir->fsckflags |= DIREMPTY;
620 if (dir->fsckflags & DIREMPTY) {
621 if (!(dir->fsckflags & DIREMPWARN)) {
623 fullpath(dir));
627 dir->fsckflags &= ~DIREMPTY;
638 dir->fsckflags |= DIREMPWARN;
640 if (dir->fsckflags & DIREMPWARN) {
644 } else if (dir->fsckflags & DIREMPTY)
760 fullpath(dir), 2);
793 dirent.parent = dir;
794 dirent.next = dir->child;
888 if (dirent.head != dir->head) {
890 fullpath(dir));
892 dirent.head = dir->head;
905 if (dir->parent) { /* XXX */
906 if (!dir->parent->parent) {
909 fullpath(dir));
919 } else if (dirent.head != dir->parent->head) {
921 fullpath(dir));
923 dirent.head = dir->parent->head;
939 * to dir->head, it's '.'.
941 if (dirent.head == dir->head) {
943 dirent.name, fullpath(dir));
975 dir->child = d;
983 n->dir = d;
1013 fullpath(dir), 1);
1044 struct dosDirEntry *dir = pendingDirectories->dir;
1057 mod |= readDosDirSection(fat, dir);
1066 * Try to reconnect a FAT chain into dir