Implemented changes proposed by the teacher.
[fsck.sofs09.git] / test_sbdzonesize.c
blobc1463489541b3d2f2090685e0ee944755fc25de8
1 #include <stdio.h>
3 #include "fsck.h"
4 #include "fsck_helper.h"
5 #include "sofs09.h"
7 testresult_t test_sbdzonesize (void)
9 testresult_t ret;
10 SOSuperBlock *sb;
12 fetch_superblock(&sb);
14 /* ceil(a/b) = (a + b - 1)/b */
16 ret = nice;
18 if (sb->dzone_size == 0) {
19 printf("Data zone is empty.\n");
20 ret = corrupt;
23 if (sb->dzone_size == 1) {
24 printf("Data zone can only store the root directory.\n");
25 ret = weird;
28 return ret;