vfs filesystem mounting

This commit is contained in:
Matheus
2022-08-02 22:14:32 -03:00
parent 8d90e27f15
commit 2419b2e9e0
6 changed files with 155 additions and 29 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <kernel/tmpfs.h>
#include <kernel/vfs.h>
#include <kernel/alloc.h>
static int tmpfs_mount(dirnode_t** rootptr, vnode_t* device, int mountflags, void* fsinfo){
fs_t* desc = alloc(sizeof(fs_t));
if(!desc)
return ENOMEM;
dirnode_t* root = vfs_newdirnode(desc, NULL);
if(!root){
free(desc);
return ENOMEM;
}
*rootptr = root;
return 0;
}
static fscalls_t funcs = {
tmpfs_mount
};
fscalls_t* tmpfs_getfuncs(){
return &funcs;
}