From 970b5b7c6a7778579a4398cdb8d0bfb6bcd33da1 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 26 Nov 2021 20:03:49 +0100 Subject: init/fs: add the MOUNT macro --- src/init/main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/init/main.c') diff --git a/src/init/main.c b/src/init/main.c index b723c7b..2fe17eb 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -43,16 +43,11 @@ void fs_prep(void) { * TODO actually write tests */ _syscall_mount(front, argify("/init/")); - /* from here on i'll just use the helper func fork2_n_mount */ + if (!fork2_n_mount("/")) fs_dir_inject("/init/"); - /* passthrough fs */ - if (!fork2_n_mount("/2nd")) - fs_passthru(NULL); - - if (!fork2_n_mount("/3nd")) - fs_passthru("/init"); - - if (!fork2_n_mount("/")) - fs_dir_inject("/test/dir/"); + /* from here on i'll just use the helper MOUNT macro */ + /* passthrough fs */ + MOUNT("/2nd/", fs_passthru(NULL)); /* copies / under /2nd */ + MOUNT("/3rd/", fs_passthru("/init/")); /* copies /init under /3rd */ } -- cgit v1.2.3