diff options
author | dzwdz | 2022-08-01 21:52:58 +0200 |
---|---|---|
committer | dzwdz | 2022-08-01 21:52:58 +0200 |
commit | 80bd52a861b6abb0e6b4a1685e4b96581dd09221 (patch) | |
tree | fd142f6e45c52df0a85b96344df437a9ea9851ed /src/user | |
parent | 5fc7009037e392ccec021b1251ddfff9a8604368 (diff) |
user/lib: move mount_at_pred away from the header
Diffstat (limited to 'src/user')
-rw-r--r-- | src/user/lib/fs/misc.c | 16 | ||||
-rw-r--r-- | src/user/lib/fs/misc.h | 16 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/user/lib/fs/misc.c b/src/user/lib/fs/misc.c index 95fef60..e47d930 100644 --- a/src/user/lib/fs/misc.c +++ b/src/user/lib/fs/misc.c @@ -202,3 +202,19 @@ void fs_dir_inject(const char *path) { } exit(0); } + +bool mount_at_pred(const char *path) { + // TODO preprocess path - simplify & ensure trailing slash + if (!fork2_n_mount(path)) { + /* child -> go into the for body */ + _klogf("%s: impl", path); + return true; + } + + if (strcmp("/", path) && !fork2_n_mount("/")) { + _klogf("%s: dir", path); + fs_dir_inject(path); + exit(1); + } + return false; /* continue after the for loop */ +} diff --git a/src/user/lib/fs/misc.h b/src/user/lib/fs/misc.h index 00f3c04..1a9c555 100644 --- a/src/user/lib/fs/misc.h +++ b/src/user/lib/fs/misc.h @@ -11,21 +11,7 @@ void fs_whitelist(const char **list); void fs_dir_inject(const char *path); -static bool mount_at_pred(const char *path) { - // TODO preprocess path - simplify & ensure trailing slash - if (!fork2_n_mount(path)) { - /* child -> go into the for body */ - _klogf("%s: impl", path); - return true; - } - - if (strcmp("/", path) && !fork2_n_mount("/")) { - _klogf("%s: dir", path); - fs_dir_inject(path); - exit(1); - } - return false; /* continue after the for loop */ -} +bool mount_at_pred(const char *path); /** Mounts something and injects its path into the fs */ #define MOUNT_AT(path) for (; mount_at_pred(path); exit(1)) |