diff options
author | Marvin Borner | 2020-07-25 00:09:10 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-25 00:09:10 +0200 |
commit | 7aebd908b0c046bb2729e2139e7c9295d81a1fbc (patch) | |
tree | f553b18c800aa8f26e619f130584b36cffc546ef | |
parent | 44861a9fd41de9b36c251df81535c9ed1cda416c (diff) |
Yet another fix
-rw-r--r-- | src/features/fs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/features/fs.c b/src/features/fs.c index 65bbe8d..d505e31 100644 --- a/src/features/fs.c +++ b/src/features/fs.c @@ -67,7 +67,8 @@ void *read_file(struct inode *in) int indirect; - // Single indirect pointer + // Singly indirect pointer + // TODO: Support doubly and triply pointers if (num_blocks > 12) indirect = in->block[12]; @@ -79,7 +80,7 @@ void *read_file(struct inode *in) data = buffer_read(blocknum); memcpy((u32 *)((u32)buf + i * BLOCK_SIZE), data, BLOCK_SIZE); } else { - blocknum = read_indirect(indirect, i - 13); + blocknum = read_indirect(indirect, i - 12); data = buffer_read(blocknum); memcpy((u32 *)((u32)buf + (i - 1) * BLOCK_SIZE), data, BLOCK_SIZE); } |