summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
authordzwdz2023-01-06 20:45:30 +0100
committerdzwdz2023-01-06 20:45:30 +0100
commite0c7bad47a54d865ef6194643e2cd20f6094e507 (patch)
treea9c731aecaad9c08ff4e732ae5dc8941a60cddd4 /src/kernel/syscalls.c
parentaedefd551da5e50f89eeaf74a7d6e1a76760ec7b (diff)
kernel: turn the NULLFS into an always present special handle
preparing for HANDLE_PROCFS
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 88e98c6..2ace0f4 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -145,13 +145,11 @@ long _syscall_mount(handle_t hid, const char __user *path, long len) {
len--;
}
- if (hid >= 0) { // mounting a real backend?
- struct handle *handle = process_handle_get(process_current, hid);
- if (!handle || handle->type != HANDLE_FS_FRONT)
- goto fail;
- backend = handle->backend;
- backend->refcount++;
- } // otherwise backend == NULL
+ struct handle *handle = process_handle_get(process_current, hid);
+ if (!handle || handle->type != HANDLE_FS_FRONT)
+ goto fail;
+ backend = handle->backend;
+ if (backend) backend->refcount++;
// append to mount list
// TODO move to kernel/vfs/mount.c