From e25a47fcc4db09ab9b845a691297da67243e6049 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Tue, 2 Apr 2024 12:03:52 +0200 Subject: Kernel: Use "struct list" to handle file descriptors instead of a fixed sized array --- kernel/fs/ext2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kernel/fs/ext2.c') 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*/, -- cgit v1.2.3