diff options
author | Marvin Borner | 2020-10-26 16:36:40 +0100 |
---|---|---|
committer | Marvin Borner | 2020-10-26 16:36:40 +0100 |
commit | 197ea3ca20879b29fca41a07cf43e5b04b9c5083 (patch) | |
tree | c0e0223e289bde3af7cca995f98d681779bfda26 /kernel/features/fs.c | |
parent | 4ae48304b2290b6c835eb3d937bd5e905ce0e5d4 (diff) |
Optimizations
Diffstat (limited to 'kernel/features/fs.c')
-rw-r--r-- | kernel/features/fs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/features/fs.c b/kernel/features/fs.c index 2db0a97..c52a7b6 100644 --- a/kernel/features/fs.c +++ b/kernel/features/fs.c @@ -68,10 +68,10 @@ void *read_inode(struct inode *in) printf("Loading %dKiB\n", sz >> 10); assert(buf != NULL); - int indirect; + int indirect = 0; - int blocknum; - char *data; + int blocknum = 0; + char *data = 0; // TODO: Support triply indirect pointers // TODO: This can be heavily optimized by saving the indirect block lists for (int i = 0; i < num_blocks; i++) { @@ -105,7 +105,7 @@ void *read_file(char *path) path++; u32 current_inode = EXT2_ROOT; - int i; + int i = 0; while (1) { for (i = 0; path[i] != '/' && path[i] != '\0'; i++) ; @@ -176,7 +176,7 @@ void ls_root() struct dirent *d = (struct dirent *)buf; int sum = 0; - int calc; + int calc = 0; printf("\nRoot directory:\n"); do { calc = (sizeof(struct dirent) + d->name_len + 4) & ~0x3; |