summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/mount.c
diff options
context:
space:
mode:
authordzwdz2022-08-28 13:33:09 +0200
committerdzwdz2022-08-28 13:33:09 +0200
commita8e0cd702f97ffc74dd29f4b873e8813b7e9f27c (patch)
tree197f8a0563f6dc070809073ecfd572cec4a63abb /src/kernel/vfs/mount.c
parentf0bda71fe2a4df4201c6195be1fe46cf895c134d (diff)
kernel/vfs: minor vfs_request / vfs_root_register rework
* changed vfs_root_register's name because the _mount didn't add anything * removed the old pointless vfs_backend_tryaccept calls from drivers * because of that, i could remove the vfs_backend globals * replaced the horrible BACKEND_KERN macro * all vfs_backends are now stored on the heap
Diffstat (limited to 'src/kernel/vfs/mount.c')
-rw-r--r--src/kernel/vfs/mount.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/kernel/vfs/mount.c b/src/kernel/vfs/mount.c
index de2d708..aa73acb 100644
--- a/src/kernel/vfs/mount.c
+++ b/src/kernel/vfs/mount.c
@@ -9,8 +9,15 @@ struct vfs_mount *vfs_mount_seed(void) {
return mount_root;
}
-void vfs_mount_root_register(const char *path, struct vfs_backend *backend) {
+void vfs_root_register(const char *path, void (*accept)(struct vfs_request *)) {
+ struct vfs_backend *backend = kmalloc(sizeof *backend);
struct vfs_mount *mount = kmalloc(sizeof *mount);
+ *backend = (struct vfs_backend) {
+ .is_user = false,
+ .potential_handlers = 1,
+ .refcount = 1,
+ .kern.accept = accept,
+ };
*mount = (struct vfs_mount){
.prev = mount_root,
.prefix = path,