réplica de
https://github.com/Arnau478/quark.git
synced 2024-11-23 12:58:07 +01:00
Fixed some VFS bugs
This commit is contained in:
pare
18f73a5357
commit
89d929bd3a
S'han modificat 2 arxius amb 16 adicions i 16 eliminacions
|
@ -21,14 +21,12 @@ void fs_open(fs_node_t *node, uint8_t read, uint8_t write){
|
|||
if(node->open != NULL){
|
||||
return node->open(node);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fs_close(fs_node_t *node){
|
||||
if(node->close != NULL){
|
||||
return node->close(node);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
dirent_t *fs_readdir(fs_node_t *node, uint32_t index){
|
||||
|
|
|
@ -10,7 +10,21 @@
|
|||
#define FS_SYMLINK 0x06
|
||||
#define FS_MOUNTPOINT 0x08
|
||||
|
||||
typedef struct fs_node{
|
||||
typedef struct fs_node fs_node_t;
|
||||
|
||||
typedef struct dirent{
|
||||
char name[128];
|
||||
uint32_t inode;
|
||||
} dirent_t;
|
||||
|
||||
typedef uint32_t (*fs_read_fn_t)(fs_node_t *, uint32_t, uint32_t, uint8_t *);
|
||||
typedef uint32_t (*fs_write_fn_t)(fs_node_t *, uint32_t, uint32_t, uint8_t *);
|
||||
typedef void (*fs_open_fn_t)(fs_node_t *);
|
||||
typedef void (*fs_close_fn_t)(fs_node_t *);
|
||||
typedef dirent_t *(*fs_readdir_fn_t)(fs_node_t *, uint32_t);
|
||||
typedef fs_node_t *(*fs_finddir_fn_t)(fs_node_t *, char *);
|
||||
|
||||
struct fs_node{
|
||||
char name[128];
|
||||
uint32_t mask;
|
||||
uint32_t uid;
|
||||
|
@ -26,19 +40,7 @@ typedef struct fs_node{
|
|||
fs_readdir_fn_t readdir;
|
||||
fs_finddir_fn_t finddir;
|
||||
struct fs_node *ptr;
|
||||
} fs_node_t;
|
||||
|
||||
typedef struct dirent{
|
||||
char name[128];
|
||||
uint32_t inode;
|
||||
} dirent_t;
|
||||
|
||||
typedef uint32_t (*fs_read_fn_t)(fs_node_t *, uint32_t, uint32_t, uint8_t *);
|
||||
typedef uint32_t (*fs_write_fn_t)(fs_node_t *, uint32_t, uint32_t, uint8_t *);
|
||||
typedef void (*fs_open_fn_t)(fs_node_t *);
|
||||
typedef void (*fs_close_fn_t)(fs_node_t *);
|
||||
typedef dirent_t *(*fs_readdir_fn_t)(fs_node_t *, uint32_t);
|
||||
typedef fs_node_t *(*fs_finddir_fn_t)(fs_node_t *, char *);
|
||||
};
|
||||
|
||||
extern fs_node_t *fs_root;
|
||||
|
||||
|
|
Loading…
Referencia en una nova incidència