3 #include "fsck_helper.h"
6 testresult_t
test_infree (void)
12 fetch_superblock(&sb
);
14 /* number of free inodes found in the free inode list */
20 /* index of the current inode */
23 /* inode status from ictable */
29 while ((inodeidx
!= NULL_INODE
) && (ret
!= corrupt
)) {
30 if (inodeidx
< sb
->itotal
) {
31 ictable_get(inodeidx
, &icstat
);
34 fret
= soReadInode(&inode
, inodeidx
);
35 if (fret
< 0) FABORT(fret
, "test_infree");
37 ictable_set(inodeidx
, idle
);
40 printf("Free inode list contains used inodes.\n");
44 printf("Free inode list closes over itself.\n");
48 printf("BUM! ictable has something strange in it.\n");
53 printf("Free inode list has a member pointing to %d, which is "
54 "outside the list.\n", inodeidx
);
57 inodeidx
= inode
.next
;
60 if ((ret
!= corrupt
) && (ifree
!= sb
->ifree
)) {
61 printf("ifree is incorrect.\n");