5 #include "fsck_helper.h"
7 testresult_t
test_sbitotal (void)
11 int itshortage
, itexcess
;
13 fetch_superblock(&sb
);
15 /* ceil(a/b) = (a + b - 1)/b */
18 if (sb
->itable_size
< (sb
->itotal
+IPB
-1)/IPB
) {
19 itshortage
= (sb
->itotal
+IPB
-1)/IPB
- (sb
->itable_size
);
20 printf("Inode table too small by %d blocks.\n", itshortage
);
23 if (sb
->itable_size
> (sb
->itotal
+IPB
-1)/IPB
) {
24 itexcess
= (sb
->itable_size
) - (sb
->itotal
+IPB
-1)/IPB
;
25 printf("Inode table too big by %d blocks.\n", itexcess
);