summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/root.c
diff options
context:
space:
mode:
authordzwdz2021-09-12 13:00:20 +0200
committerdzwdz2021-09-12 13:00:20 +0200
commit625ae265cbabe76bd272e9e8f0f637635af64b23 (patch)
tree6edecc8fa0053fc4fda0d079fbc1f3bdaac6fe7e /src/kernel/vfs/root.c
parente65d58357aaff7c1d05c06753538383478c1b0e9 (diff)
vfs_request refactor pt2
Diffstat (limited to 'src/kernel/vfs/root.c')
-rw-r--r--src/kernel/vfs/root.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/vfs/root.c b/src/kernel/vfs/root.c
index 29caf14..feb718d 100644
--- a/src/kernel/vfs/root.c
+++ b/src/kernel/vfs/root.c
@@ -8,18 +8,19 @@
int vfs_root_handler(struct vfs_request *req) {
switch (req->type) {
case VFSOP_OPEN:
- if (req->open.path_len == 4
- && !memcmp(req->open.path, "/tty", 4)) {
+ assert(req->input.kern);
+ if (req->input.len == 4
+ && !memcmp(req->input.buf_kern, "/tty", 4)) {
return 0;
}
return -1;
case VFSOP_WRITE:
- switch (req->rw.id) {
+ switch (req->id) {
// every id corresponds to a special file type
// this is a shit way to do this but :shrug:
case 0: { // tty
struct virt_iter iter;
- virt_iter_new(&iter, req->rw.buf, req->rw.buf_len,
+ virt_iter_new(&iter, req->input.buf, req->input.len,
req->caller->pages, true, false);
while (virt_iter_next(&iter))
tty_write(iter.frag, iter.frag_len);