aboutsummaryrefslogtreecommitdiff
path: root/src/libdiskfs
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-06-15 04:35:57 +0000
committerrsc <devnull@localhost>2006-06-15 04:35:57 +0000
commit9bbcb80d35f8868a90603368078f91ba56cfe0d3 (patch)
treea005c1353811c426a9ea55e59d4416c9f865653a /src/libdiskfs
parent751ff8ab61cc89cc7c351e1874720a61b865077f (diff)
downloadplan9port-9bbcb80d35f8868a90603368078f91ba56cfe0d3.tar.gz
plan9port-9bbcb80d35f8868a90603368078f91ba56cfe0d3.tar.bz2
plan9port-9bbcb80d35f8868a90603368078f91ba56cfe0d3.zip
ext2 fixes (Steve VanDeBogart)
Diffstat (limited to 'src/libdiskfs')
-rw-r--r--src/libdiskfs/ext2.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libdiskfs/ext2.c b/src/libdiskfs/ext2.c
index 8473aa34..ddd3d7b8 100644
--- a/src/libdiskfs/ext2.c
+++ b/src/libdiskfs/ext2.c
@@ -88,7 +88,7 @@ ext2blockread(Fsys *fsys, u64int vbno)
Group *g;
Block *gb;
uchar *bits;
- u32int bno, boff;
+ u32int bno, boff, bitpos;
Ext2 *fs;
fs = fsys->priv;
@@ -115,11 +115,12 @@ ext2blockread(Fsys *fsys, u64int vbno)
if(debug)
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)
fprint(2, "loading bitblock: %r...");
- blockput(gb);
return nil;
}
bits = bitb->data;
@@ -128,9 +129,9 @@ ext2blockread(Fsys *fsys, u64int vbno)
if(debug)
fprint(2, "block %d not allocated...", bno);
blockput(bitb);
- blockput(gb);
return nil;
}
+ blockput(bitb);
bno += fs->firstblock;
return diskread(fs->disk, fs->blocksize, (u64int)bno*fs->blocksize);