2 * Copyright (c) 1980, 1986 The Regents of the University of California.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 #include <afsconfig.h>
19 #include <afs/param.h>
27 #ifdef AFS_VFSINCL_ENV
28 #include <sys/vnode.h>
30 #include <sys/fs/ufs_inode.h>
31 #include <sys/fs/ufs_fs.h>
33 #include <sys/fs/ufs_fsdir.h>
35 #include <sys/fs/ufs_mount.h>
37 #include <ufs/inode.h>
40 #else /* AFS_VFSINCL_ENV */
41 #include <sys/inode.h>
43 #define LONGFILENAMES 1
44 #include <sys/sysmacros.h>
48 #endif /* AFS_VFSINCL_ENV */
50 #include <afs/osi_inode.h>
59 ino_t inumber, orphan;
62 memset(&idesc, 0, sizeof(struct inodesc));
64 for (inumber = ROOTINO; inumber <= lastino; inumber++) {
65 #if defined(ACLS) && defined(AFS_HPUX_ENV)
66 if (statemap[inumber] & HASCINODE) {
67 if ((dp = ginode(inumber)) == NULL)
70 * Make sure di_contin is not out of range and then
71 * check and make sure that the inode #di_contin
72 * is a continuation inode that has not already been
75 if ((dp->di_contin < ROOTINO || dp->di_contin > maxino)
76 || ((statemap[dp->di_contin] & STATE) != CSTATE)) {
77 /* this is an error which must be cleared by hand. */
78 pfatal("BAD CONTINUATION INODE NUMBER ");
79 printf(" I=%u ", inumber);
80 if (reply("CLEAR") == 1) {
85 statemap[dp->di_contin] = CRSTATE;
88 if ((statemap[inumber] & STATE) == DSTATE) {
90 if (statemap[inumber] == DSTATE) {
95 idesc.id_func = findino;
97 idesc.id_parent = inumber;
100 orphan = idesc.id_parent;
101 if (orphan < ROOTINO || orphan > maxino)
105 idesc.id_number = orphan;
106 if ((ckinode(dp, &idesc) & FOUND) == 0)
108 if (loopcnt >= sblock.fs_cstotal.cs_ndir)
111 #if defined(ACLS) && defined(AFS_HPUX_ENV)
112 } while ((statemap[idesc.id_parent] & STATE) == DSTATE);
114 } while (statemap[idesc.id_parent] == DSTATE);
116 if (linkup(orphan, idesc.id_parent) == 1) {
117 idesc.id_func = pass2check;
118 idesc.id_number = lfdir;
119 descend(&idesc, orphan);