feat(iso): modified fd struct and func proto

This commit is contained in:
aliamelo committed 2022-04-24 02:17:53 +02:00
1 parent 1daa8e6263
commit 04bbb27df6
2 files changed
+7 -5

No files matched your search

+3 -4
View File
@@ -1,6 +1,6 @@
#include "fd.h"
static struct file_entry fd_table[MAX_FD] = { 0 };
struct file_entry fd_table[MAX_FD] = { 0 };
static int find_next_fd(void)
{
@@ -13,14 +13,13 @@ static int find_next_fd(void)
return -1;
}
int register_fd(u32 lba, u32 file_size)
int register_fd(u32 lba, u32 file_size, u8 is_dir)
{
int free_fd = find_next_fd();
if (free_fd < 0)
return -1;
struct file_entry f = { .open = 0, .lba = lba, .file_offset = 0,
.file_size = file_size };
struct file_entry f = { 0, lba, 0, file_size, is_dir };
fd_table[free_fd] = f;
return free_fd;
}
+4 -1
View File
@@ -11,9 +11,12 @@ struct file_entry
u32 lba;
u32 file_offset;
u32 file_size;
u8 is_dir;
};
int register_fd(u32 lba, u32 file_size);
extern struct file_entry fd_table[MAX_FD];
int register_fd(u32 lba, u32 file_size, u8 is_dir);
int destroy_fd(int fd);
#endif /* !FD_H */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.