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>
23 #include <sys/param.h>
26 #include <sys/vnode.h>
27 #include <sys/mount.h>
28 #include <ufs/inode.h>
36 #else /* AFS_OSF_ENV */
37 #ifdef AFS_VFSINCL_ENV
38 #include <sys/vnode.h>
42 #include <sys/fs/ufs_inode.h>
43 #include <sys/fs/ufs_fs.h>
45 #include <sys/fs/ufs_fsdir.h>
47 #include <sys/fs/ufs_mount.h>
49 #include <ufs/inode.h>
52 #else /* AFS_VFSINCL_ENV */
53 #include <sys/inode.h>
56 #define LONGFILENAMES 1
57 #include <sys/sysmacros.h>
61 #endif /* AFS_VFSINCL_ENV */
62 #endif /* AFS_OSF_ENV */
63 #include <afs/osi_inode.h>
75 #if defined(ACLS) && defined(AFS_HPUX_ENV)
80 memset(&idesc, 0, sizeof(struct inodesc));
82 idesc.id_func = pass4check;
83 for (inumber = ROOTINO; inumber <= lastino; inumber++) {
84 idesc.id_number = inumber;
85 #if defined(ACLS) && defined(AFS_HPUX_ENV)
86 switch (statemap[inumber] & STATE) {
88 switch (statemap[inumber]) {
95 adjust(&idesc, (short)n);
97 for (zlnp = zlnhead; zlnp; zlnp = zlnp->next)
98 if (zlnp->zlncnt == inumber) {
99 zlnp->zlncnt = zlnhead->zlncnt;
101 zlnhead = zlnhead->next;
103 clri(&idesc, "UNREF", 1);
116 clri(&idesc, "UNREF", 1);
121 clri(&idesc, "BAD/DUP", 1);
127 #if defined(ACLS) && defined(AFS_HPUX_ENV)
129 * UNreferenced continuation inode
132 clri(&idesc, "UNREF", 2);
136 * referenced continuation inode
139 if ((dp = ginode(inumber)) == NULL)
141 if (dp->di_nlink != 1)
143 pwarn("BAD LINK COUNT IN CONTINUATION INODE ");
144 pwarn("I=%u (%ld should be %ld)", inumber, dp->di_nlink,
148 vprintf(" (CORRECTED)\n");
150 printf(" (CORRECTED)\n");
153 if (reply("CORRECT") == 0)
163 errexit("BAD STATE %d FOR INODE I=%d", statemap[inumber],
170 struct inodesc *idesc;
173 int nfrags, res = KEEPON;
174 daddr_t blkno = idesc->id_blkno;
176 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) {
177 if (chkrange(blkno, 1)) {
179 } else if (testbmap(blkno)) {
180 for (dlp = duplist; dlp; dlp = dlp->next) {
181 if (dlp->dup != blkno)
183 dlp->dup = duplist->dup;
185 duplist = duplist->next;