ext2 fixes (Steve VanDeBogart)
This commit is contained in:
parent
751ff8ab61
commit
9bbcb80d35
1 changed files with 5 additions and 4 deletions
|
|
@ -88,7 +88,7 @@ ext2blockread(Fsys *fsys, u64int vbno)
|
||||||
Group *g;
|
Group *g;
|
||||||
Block *gb;
|
Block *gb;
|
||||||
uchar *bits;
|
uchar *bits;
|
||||||
u32int bno, boff;
|
u32int bno, boff, bitpos;
|
||||||
Ext2 *fs;
|
Ext2 *fs;
|
||||||
|
|
||||||
fs = fsys->priv;
|
fs = fsys->priv;
|
||||||
|
|
@ -115,11 +115,12 @@ ext2blockread(Fsys *fsys, u64int vbno)
|
||||||
if(debug)
|
if(debug)
|
||||||
fprint(2, "group %d bitblock=%d...", bno/fs->blockspergroup, g->bitblock);
|
fprint(2, "group %d bitblock=%d...", bno/fs->blockspergroup, g->bitblock);
|
||||||
*/
|
*/
|
||||||
|
bitpos = (u64int)g->bitblock*fs->blocksize;
|
||||||
|
blockput(gb);
|
||||||
|
|
||||||
if((bitb = diskread(fs->disk, fs->blocksize, (u64int)g->bitblock*fs->blocksize)) == nil){
|
if((bitb = diskread(fs->disk, fs->blocksize, bitpos)) == nil){
|
||||||
if(debug)
|
if(debug)
|
||||||
fprint(2, "loading bitblock: %r...");
|
fprint(2, "loading bitblock: %r...");
|
||||||
blockput(gb);
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
bits = bitb->data;
|
bits = bitb->data;
|
||||||
|
|
@ -128,9 +129,9 @@ ext2blockread(Fsys *fsys, u64int vbno)
|
||||||
if(debug)
|
if(debug)
|
||||||
fprint(2, "block %d not allocated...", bno);
|
fprint(2, "block %d not allocated...", bno);
|
||||||
blockput(bitb);
|
blockput(bitb);
|
||||||
blockput(gb);
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
blockput(bitb);
|
||||||
|
|
||||||
bno += fs->firstblock;
|
bno += fs->firstblock;
|
||||||
return diskread(fs->disk, fs->blocksize, (u64int)bno*fs->blocksize);
|
return diskread(fs->disk, fs->blocksize, (u64int)bno*fs->blocksize);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue