Lines Matching defs:dir
38 __RCSID("$NetBSD: dir.c,v 1.14 1998/08/25 19:18:15 ross Exp $");
40 "$FreeBSD: src/sbin/fsck_msdosfs/dir.c,v 1.3 2003/12/26 17:24:37 trhodes Exp $";
95 /* dir.c */
170 fullpath(struct dosDirEntry *dir)
179 np = dir->lname[0] ? dir->lname : dir->name;
185 } while ((dir = dir->parent) != NULL);
186 if (dir)
391 struct dosDirEntry *dir)
398 if (dir->head == CLUST_FREE)
401 if (dir->head < CLUST_FIRST || dir->head >= boot->NumClusters)
403 physicalSize = fat[dir->head].length * boot->ClusterSize;
405 if (physicalSize < dir->size) {
407 fullpath(dir), dir->size, physicalSize);
409 dir->size = physicalSize;
417 } else if (physicalSize - dir->size >= boot->ClusterSize) {
419 fullpath(dir));
424 for (cl = dir->head; (sz += boot->ClusterSize) < dir->size;)
443 check_dot_dot(int f, struct bootblock *boot, struct fatEntry *fat,struct dosDirEntry *dir)
453 cl = dir->head;
455 if (dir->parent && (cl < CLUST_FIRST || cl >= boot->NumClusters)) {
460 if (!(boot->flags & FAT32) && !dir->parent) {
509 pwarn("%s: '.' absent for %s.\n",__func__,dir->name);
512 pwarn("%s: '..' absent for %s. \n",__func__,dir->name);
526 struct dosDirEntry *dir)
541 cl = dir->head;
542 if (dir->parent && (cl < CLUST_FIRST || cl >= boot->NumClusters)) {
554 if (!(boot->flags & FAT32) && !dir->parent) {
574 if (dir->fsckflags & DIREMPWARN) {
581 dir->fsckflags |= DIREMPTY;
588 if (dir->fsckflags & DIREMPTY) {
589 if (!(dir->fsckflags & DIREMPWARN)) {
591 fullpath(dir));
595 dir->fsckflags &= ~DIREMPTY;
605 dir->fsckflags |= DIREMPWARN;
607 if (dir->fsckflags & DIREMPWARN) {
611 } else if (dir->fsckflags & DIREMPTY)
717 fullpath(dir), 2);
749 dirent.parent = dir;
750 dirent.next = dir->child;
785 && dir->parent /* XXX */
786 && !dir->parent->parent) {
857 if (dirent.head != dir->head) {
859 fullpath(dir));
861 dirent.head = dir->head;
874 if (dir->parent) { /* XXX */
875 if (!dir->parent->parent) {
878 fullpath(dir));
888 } else if (dirent.head != dir->parent->head) {
890 fullpath(dir));
892 dirent.head = dir->parent->head;
905 } else { //only one directory entry can point to dir->head, it's '.'
906 if (dirent.head == dir->head) {
908 dirent.name, fullpath(dir));
939 dir->child = d;
950 n->dir = d;
973 fullpath(dir), 1);
990 struct dosDirEntry *dir = pendingDirectories->dir;
1003 mod |= readDosDirSection(dosfs, boot, fat, dir);
1012 * Try to reconnect a FAT chain into dir
1065 perror("could not read LOST.DIR");
1095 perror("could not write LOST.DIR");