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>
26 #ifdef AFS_VFSINCL_ENV
27 #include <sys/vnode.h>
29 #include <sys/fs/ufs_inode.h>
30 #include <sys/fs/ufs_fs.h>
32 #include <sys/fs/ufs_fsdir.h>
34 #include <sys/fs/ufs_mount.h>
36 #include <ufs/inode.h>
39 #else /* AFS_VFSINCL_ENV */
40 #include <sys/inode.h>
42 #define LONGFILENAMES 1
43 #include <sys/sysmacros.h>
47 #endif /* AFS_VFSINCL_ENV */
48 #include <afs/osi_inode.h>
60 #if defined(ACLS) && defined(AFS_HPUX_ENV)
65 memset(&idesc, 0, sizeof(struct inodesc));
67 idesc.id_func = pass4check;
68 for (inumber = ROOTINO; inumber <= lastino; inumber++) {
69 idesc.id_number = inumber;
70 #if defined(ACLS) && defined(AFS_HPUX_ENV)
71 switch (statemap[inumber] & STATE) {
73 switch (statemap[inumber]) {
80 adjust(&idesc, (short)n);
82 for (zlnp = zlnhead; zlnp; zlnp = zlnp->next)
83 if (zlnp->zlncnt == inumber) {
84 zlnp->zlncnt = zlnhead->zlncnt;
86 zlnhead = zlnhead->next;
88 clri(&idesc, "UNREF", 1);
101 clri(&idesc, "UNREF", 1);
106 clri(&idesc, "BAD/DUP", 1);
112 #if defined(ACLS) && defined(AFS_HPUX_ENV)
114 * UNreferenced continuation inode
117 clri(&idesc, "UNREF", 2);
121 * referenced continuation inode
124 if ((dp = ginode(inumber)) == NULL)
126 if (dp->di_nlink != 1)
128 pwarn("BAD LINK COUNT IN CONTINUATION INODE ");
129 pwarn("I=%u (%ld should be %ld)", inumber, dp->di_nlink,
132 printf(" (CORRECTED)\n");
134 if (reply("CORRECT") == 0)
144 errexit("BAD STATE %d FOR INODE I=%d", statemap[inumber],
151 struct inodesc *idesc;
154 int nfrags, res = KEEPON;
155 daddr_t blkno = idesc->id_blkno;
157 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) {
158 if (chkrange(blkno, 1)) {
160 } else if (testbmap(blkno)) {
161 for (dlp = duplist; dlp; dlp = dlp->next) {
162 if (dlp->dup != blkno)
164 dlp->dup = duplist->dup;
166 duplist = duplist->next;