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>
28 #include <sys/vnode.h>
29 #include <sys/mount.h>
30 #include <ufs/inode.h>
37 #else /* AFS_OSF_ENV */
38 #ifdef AFS_VFSINCL_ENV
39 #include <sys/vnode.h>
41 #include <sys/fs/ufs_inode.h>
42 #include <sys/fs/ufs_fs.h>
44 #include <sys/fs/ufs_fsdir.h>
46 #include <sys/fs/ufs_mount.h>
48 #include <ufs/inode.h>
51 #else /* AFS_VFSINCL_ENV */
52 #include <sys/inode.h>
54 #define LONGFILENAMES 1
55 #include <sys/sysmacros.h>
59 #endif /* AFS_VFSINCL_ENV */
60 #endif /* AFS_OSF_ENV */
62 #include <afs/osi_inode.h>
71 ino_t inumber
, orphan
;
74 memset(&idesc
, 0, sizeof(struct inodesc
));
76 for (inumber
= ROOTINO
; inumber
<= lastino
; inumber
++) {
77 #if defined(ACLS) && defined(AFS_HPUX_ENV)
78 if (statemap
[inumber
] & HASCINODE
) {
79 if ((dp
= ginode(inumber
)) == NULL
)
82 * Make sure di_contin is not out of range and then
83 * check and make sure that the inode #di_contin
84 * is a continuation inode that has not already been
87 if ((dp
->di_contin
< ROOTINO
|| dp
->di_contin
> maxino
)
88 || ((statemap
[dp
->di_contin
] & STATE
) != CSTATE
)) {
89 /* this is an error which must be cleared by hand. */
90 pfatal("BAD CONTINUATION INODE NUMBER ");
91 printf(" I=%u ", inumber
);
92 if (reply("CLEAR") == 1) {
97 statemap
[dp
->di_contin
] = CRSTATE
;
100 if ((statemap
[inumber
] & STATE
) == DSTATE
) {
102 if (statemap
[inumber
] == DSTATE
) {
107 idesc
.id_func
= findino
;
108 idesc
.id_name
= "..";
109 idesc
.id_parent
= inumber
;
112 orphan
= idesc
.id_parent
;
113 if (orphan
< ROOTINO
|| orphan
> maxino
)
117 idesc
.id_number
= orphan
;
118 if ((ckinode(dp
, &idesc
) & FOUND
) == 0)
120 if (loopcnt
>= sblock
.fs_cstotal
.cs_ndir
)
123 #if defined(ACLS) && defined(AFS_HPUX_ENV)
124 } while ((statemap
[idesc
.id_parent
] & STATE
) == DSTATE
);
126 } while (statemap
[idesc
.id_parent
] == DSTATE
);
128 if (linkup(orphan
, idesc
.id_parent
) == 1) {
129 idesc
.id_func
= pass2check
;
130 idesc
.id_number
= lfdir
;
131 descend(&idesc
, orphan
);