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>
24 #include <sys/param.h>
28 #include <sys/vnode.h>
29 #include <sys/mount.h>
30 #include <ufs/inode.h>
38 #else /* AFS_OSF_ENV */
39 #ifdef AFS_VFSINCL_ENV
40 #include <sys/vnode.h>
44 #include <sys/fs/ufs_inode.h>
45 #include <sys/fs/ufs_fs.h>
47 #include <sys/fs/ufs_fsdir.h>
49 #include <sys/fs/ufs_mount.h>
51 #include <ufs/inode.h>
54 #else /* AFS_VFSINCL_ENV */
55 #include <sys/inode.h>
58 #define LONGFILENAMES 1
59 #include <sys/sysmacros.h>
63 #endif /* AFS_VFSINCL_ENV */
64 #endif /* AFS_OSF_ENV */
66 #include <afs/osi_inode.h>
73 register struct dinode *dp;
75 ino_t inumber, orphan;
78 memset((char *)&idesc, 0, sizeof(struct inodesc));
80 for (inumber = ROOTINO; inumber <= lastino; inumber++) {
81 #if defined(ACLS) && defined(AFS_HPUX_ENV)
82 if (statemap[inumber] & HASCINODE) {
83 if ((dp = ginode(inumber)) == NULL)
86 * Make sure di_contin is not out of range and then
87 * check and make sure that the inode #di_contin
88 * is a continuation inode that has not already been
91 if ((dp->di_contin < ROOTINO || dp->di_contin > maxino) ||
92 ((statemap[dp->di_contin] & STATE) != CSTATE))
94 /* this is an error which must be cleared by hand. */
95 pfatal("BAD CONTINUATION INODE NUMBER ");
97 vprintf(" I=%u ", inumber);
99 printf(" I=%u ", inumber);
101 if (reply("CLEAR") == 1) {
106 statemap[dp->di_contin] = CRSTATE;
109 if ((statemap[inumber] & STATE) == DSTATE) {
111 if (statemap[inumber] == DSTATE) {
116 idesc.id_func = findino;
117 idesc.id_name = "..";
118 idesc.id_parent = inumber;
121 orphan = idesc.id_parent;
122 if (orphan < ROOTINO || orphan > maxino)
126 idesc.id_number = orphan;
127 if ((ckinode(dp, &idesc) & FOUND) == 0)
129 if (loopcnt >= sblock.fs_cstotal.cs_ndir)
132 #if defined(ACLS) && defined(AFS_HPUX_ENV)
133 } while ((statemap[idesc.id_parent] & STATE) == DSTATE);
135 } while (statemap[idesc.id_parent] == DSTATE);
137 if (linkup(orphan, idesc.id_parent) == 1) {
138 idesc.id_func = pass2check;
139 idesc.id_number = lfdir;
140 descend(&idesc, orphan);