Mark all mkfs chunks allocated in bitmap

The initial bitmap entry written in the ring by mkfs was off by one.
Three chunks were written but the 0th chunk is also free for the supers.
It has to mark the first four chunks as allocated.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-03-17 17:05:24 -07:00
parent e59d0af199
commit a0a3ef9675

View File

@@ -133,8 +133,8 @@ static int write_new_fs(char *path, int fd)
ent->len = cpu_to_le16(sizeof(*bm)); ent->len = cpu_to_le16(sizeof(*bm));
bm = (void *)(ent + 1); bm = (void *)(ent + 1);
memset(bm->bits, 0xff, sizeof(bm->bits)); memset(bm->bits, 0xff, sizeof(bm->bits));
/* the first three blocks are allocated */ /* the first four chunks are allocated */
bm->bits[0] = cpu_to_le64(~7ULL); bm->bits[0] = cpu_to_le64(~15ULL);
bm->bits[1] = cpu_to_le64(~0ULL); bm->bits[1] = cpu_to_le64(~0ULL);
blkno += SCOUTFS_BLOCKS_PER_CHUNK; blkno += SCOUTFS_BLOCKS_PER_CHUNK;