diff options
author | Anton Kling <anton@kling.gg> | 2024-04-02 12:03:52 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-04-02 12:03:52 +0200 |
commit | e25a47fcc4db09ab9b845a691297da67243e6049 (patch) | |
tree | dfb7c473e001fa93a1a8018c36992a5bc77ae5c3 /kernel/fs/ext2.c | |
parent | 2229fd91f7230ae7068814ae029b733945852eb1 (diff) |
Kernel: Use "struct list" to handle file descriptors instead of a fixed sized array
Diffstat (limited to 'kernel/fs/ext2.c')
-rw-r--r-- | kernel/fs/ext2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/fs/ext2.c b/kernel/fs/ext2.c index 167c2aa..e815e79 100644 --- a/kernel/fs/ext2.c +++ b/kernel/fs/ext2.c @@ -806,8 +806,10 @@ vfs_inode_t *ext2_mount(void) { cache = kcalloc(3000, sizeof(struct BLOCK_CACHE)); // TODO: Can this be done better? Maybe create a seperate function in // the VFS? - mount_fd = current_task->file_descriptors[fd]; - current_task->file_descriptors[fd] = NULL; + mount_fd = get_vfs_fd(fd, NULL); + // Remove the FD from the current task + // FIXME: This is a hacky solution + list_set(¤t_task->file_descriptors, fd, NULL); parse_superblock(); return vfs_create_inode( 0 /*inode_num*/, 0 /*type*/, 0 /*has_data*/, 0 /*can_write*/, |