2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 This utility is used to increase the ref count on inodes moved to
12 lost+found by the non-AFS fsck. The program needs to be run once
13 for every volume located on the partition that was fsck'ed.
18 foreach volid ( cat <list-of-vol-ids> )
19 fixit lost+found $volid
23 /etc/vfsck <dev> <<<< AFS Version!
25 Non-AFS fsck causes inodes to be moved to lost+found, with names like
26 #<inode-no>. The volumes associated with these inodes will still be
27 available, until the #<inode-no> file is removed. This program simply
28 ups the ref count on the #<inode-no> files, so they're not returned
29 to the free list when the files are removed from lost+found
32 #include <afs/param.h>
33 #include <afsconfig.h>
37 #include <sys/types.h>
42 #include <sys/mknod.h>
44 #include <afs/afs_args.h>
46 #include <afs/afssyscalls.h>
49 #include "AFS_component_version_number.c"
63 printf("must be run as root; sorry\n");
66 code = stat(argv[1], &ts);
68 printf("can't stat %s\n", argv[1]);
72 tdir = opendir(argv[1]);
74 printf("cant open %s\n", argv[1]);
77 volid = atoi(argv[2]);
78 for(tde=readdir(tdir); tde; tde=readdir(tdir)) {
79 if (tde->d_name[0] == '#') {
80 printf("Inode %d\n", tde->d_ino);
81 code = IINC(dev, tde->d_ino, volid);
84 printf("errno = %d\n", errno);
85 /* Remove this -- we don't want to exit, because we have to look
86 * at each inode -- an error here means only that the iinc failed for
91 printf("inode %d restored for volume %d\n", tde->d_ino, volid);