Skip to content

Commit c28e177

Browse files
committed
Use BPB
1 parent 44f1ffb commit c28e177

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mkfs/mkfs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// Disk layout:
2121
// [ boot block | sb block | log | inode blocks | free bit map | data blocks ]
2222

23-
int nbitmap = FSSIZE/(BSIZE*8) + 1;
23+
int nbitmap = FSSIZE/BPB + 1;
2424
int ninodeblocks = NINODES / IPB + 1;
2525
int nlog = LOGSIZE;
2626
int nmeta; // Number of meta blocks (boot, sb, nlog, inode, bitmap)
@@ -240,7 +240,7 @@ balloc(int used)
240240
int i;
241241

242242
printf("balloc: first %d blocks have been allocated\n", used);
243-
assert(used < BSIZE*8);
243+
assert(used < BPB);
244244
bzero(buf, BSIZE);
245245
for(i = 0; i < used; i++){
246246
buf[i/8] = buf[i/8] | (0x1 << (i%8));

0 commit comments

Comments
 (0)