Update documentation, fix EXT2 inode selection bug
diff --git a/src/kernel/dri/fs/ext2/ext2.c b/src/kernel/dri/fs/ext2/ext2.c
index ad416be..78dd24e 100644
--- a/src/kernel/dri/fs/ext2/ext2.c
+++ b/src/kernel/dri/fs/ext2/ext2.c
@@ -288,10 +288,10 @@
{
const uint block_size = ext2_block_size(sb);
- while (index > block_size)
+ while (*index > block_size)
{
- index -= block_size;
- bitmap_block += 1;
+ *index -= block_size;
+ *bitmap_block += 1;
}
return block_size;
@@ -357,7 +357,7 @@
kprintf(DEBUG "buffer[i] = 0x%x, i = %d, index = %d\n",
buffer[i], i, index);
- // __builtin_ffs gives us the index of the least-significant 1
+ // __builtin_ffs gives us 1+the index of the least-significant 1
// bit. Since we take the bitwise inverse this is actuall the
// least significant 0 bit. This is a GCC intrinsic. This works
// particularly well on little-endian systems where the least
@@ -369,7 +369,7 @@
// | this is the MSB
//
// This means that the LSB is also the first bit in the bitset.
- uint trailing = __builtin_ffs(~buffer[i]);
+ uint trailing = __builtin_ffs(~buffer[i]) - 1;
kprintf(DEBUG "Trailing = %d, 0x%x\n", trailing, trailing);