diff options
author | Marvin Borner | 2020-01-20 23:12:54 +0100 |
---|---|---|
committer | Marvin Borner | 2020-01-20 23:12:54 +0100 |
commit | 391ed256d21a6ae2e2456d1809f357e6e96e15d1 (patch) | |
tree | 0fe9ffb3c59bbfeb3d8a04ab7fc6efba60d81e79 /src/kernel/fs/marfs/new_file.c | |
parent | d5d1749257ff8b9aa6b5ace4b4720b484a2860f3 (diff) |
Added pure awesomeness
Actually quite some days of work but ok
Diffstat (limited to 'src/kernel/fs/marfs/new_file.c')
-rw-r--r-- | src/kernel/fs/marfs/new_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/fs/marfs/new_file.c b/src/kernel/fs/marfs/new_file.c index 4fef3b9..ab1c241 100644 --- a/src/kernel/fs/marfs/new_file.c +++ b/src/kernel/fs/marfs/new_file.c @@ -1,7 +1,7 @@ #include <stdint.h> #include <kernel/fs/ata_pio.h> -#include <kernel/lib/stdlib.h> #include <kernel/fs/marfs/marfs.h> +#include <kernel/memory/kheap.h> static uint8_t last_max_level = 0; @@ -30,17 +30,17 @@ void marfs_update_recursive(uint8_t level, uint32_t i, uint32_t rec_lba, uint32_ uint32_t contents_idx = contents[idx]; kfree(contents); if (level != 1) { - marfs_update_recursive(level - 1, i, contents_idx, real_lba); + marfs_update_recursive((uint8_t) (level - 1), i, contents_idx, real_lba); } last_max_level = 0; } uint32_t marfs_new_file(uint64_t size, uint8_t *data, uint32_t uid, uint8_t exec, uint8_t dir) { - struct marfs_inode *inode = (struct marfs_inode *) kcalloc(1, 512); + struct marfs_inode *inode = (struct marfs_inode *) kmalloc(512); inode->size = size; inode->creation_time = inode->last_mod_time = inode->last_access_time = 0; // TODO: POSIX time - inode->n_blocks = size / 512; + inode->n_blocks = (uint32_t) (size / 512); if (size % 512) inode->n_blocks++; inode->uid = uid; inode->is_app = exec; |