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 #include <sys/vnode.h>
28 #include <sys/mount.h>
29 #include <ufs/inode.h>
36 #else /* AFS_OSF_ENV */
37 #ifdef AFS_VFSINCL_ENV
38 #include <sys/vnode.h>
40 #include <sys/fs/ufs_inode.h>
41 #include <sys/fs/ufs_fs.h>
43 #include <sys/fs/ufs_fsdir.h>
45 #include <sys/fs/ufs_mount.h>
47 #include <ufs/inode.h>
50 #else /* AFS_VFSINCL_ENV */
51 #include <sys/inode.h>
53 #define LONGFILENAMES 1
54 #include <sys/sysmacros.h>
58 #endif /* AFS_VFSINCL_ENV */
59 #endif /* AFS_OSF_ENV */
60 #include <afs/osi_inode.h>
72 #if defined(ACLS) && defined(AFS_HPUX_ENV)
77 memset(&idesc
, 0, sizeof(struct inodesc
));
79 idesc
.id_func
= pass4check
;
80 for (inumber
= ROOTINO
; inumber
<= lastino
; inumber
++) {
81 idesc
.id_number
= inumber
;
82 #if defined(ACLS) && defined(AFS_HPUX_ENV)
83 switch (statemap
[inumber
] & STATE
) {
85 switch (statemap
[inumber
]) {
92 adjust(&idesc
, (short)n
);
94 for (zlnp
= zlnhead
; zlnp
; zlnp
= zlnp
->next
)
95 if (zlnp
->zlncnt
== inumber
) {
96 zlnp
->zlncnt
= zlnhead
->zlncnt
;
98 zlnhead
= zlnhead
->next
;
100 clri(&idesc
, "UNREF", 1);
113 clri(&idesc
, "UNREF", 1);
118 clri(&idesc
, "BAD/DUP", 1);
124 #if defined(ACLS) && defined(AFS_HPUX_ENV)
126 * UNreferenced continuation inode
129 clri(&idesc
, "UNREF", 2);
133 * referenced continuation inode
136 if ((dp
= ginode(inumber
)) == NULL
)
138 if (dp
->di_nlink
!= 1)
140 pwarn("BAD LINK COUNT IN CONTINUATION INODE ");
141 pwarn("I=%u (%ld should be %ld)", inumber
, dp
->di_nlink
,
144 printf(" (CORRECTED)\n");
146 if (reply("CORRECT") == 0)
156 errexit("BAD STATE %d FOR INODE I=%d", statemap
[inumber
],
163 struct inodesc
*idesc
;
166 int nfrags
, res
= KEEPON
;
167 daddr_t blkno
= idesc
->id_blkno
;
169 for (nfrags
= idesc
->id_numfrags
; nfrags
> 0; blkno
++, nfrags
--) {
170 if (chkrange(blkno
, 1)) {
172 } else if (testbmap(blkno
)) {
173 for (dlp
= duplist
; dlp
; dlp
= dlp
->next
) {
174 if (dlp
->dup
!= blkno
)
176 dlp
->dup
= duplist
->dup
;
178 duplist
= duplist
->next
;