Use BPB
This commit is contained in:
parent
44f1ffbe38
commit
c28e177f8d
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@
|
||||||
// Disk layout:
|
// Disk layout:
|
||||||
// [ boot block | sb block | log | inode blocks | free bit map | data blocks ]
|
// [ boot block | sb block | log | inode blocks | free bit map | data blocks ]
|
||||||
|
|
||||||
int nbitmap = FSSIZE/(BSIZE*8) + 1;
|
int nbitmap = FSSIZE/BPB + 1;
|
||||||
int ninodeblocks = NINODES / IPB + 1;
|
int ninodeblocks = NINODES / IPB + 1;
|
||||||
int nlog = LOGSIZE;
|
int nlog = LOGSIZE;
|
||||||
int nmeta; // Number of meta blocks (boot, sb, nlog, inode, bitmap)
|
int nmeta; // Number of meta blocks (boot, sb, nlog, inode, bitmap)
|
||||||
|
@ -240,7 +240,7 @@ balloc(int used)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("balloc: first %d blocks have been allocated\n", used);
|
printf("balloc: first %d blocks have been allocated\n", used);
|
||||||
assert(used < BSIZE*8);
|
assert(used < BPB);
|
||||||
bzero(buf, BSIZE);
|
bzero(buf, BSIZE);
|
||||||
for(i = 0; i < used; i++){
|
for(i = 0; i < used; i++){
|
||||||
buf[i/8] = buf[i/8] | (0x1 << (i%8));
|
buf[i/8] = buf[i/8] | (0x1 << (i%8));
|
||||||
|
|
Loading…
Add table
Reference in a new issue