summaryrefslogtreecommitdiff
path: root/src/user/lib/fs/misc.h
blob: 1e4195623aa1af0efe8d65cd6d2e114574d1e90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once
#include <stdbool.h>
#include <user/lib/stdlib.h>

bool fork2_n_mount(const char *path);

void fs_passthru(const char *prefix);
void fs_whitelist(const char **list);

void fs_dir_inject(const char *path);

/** Mounts something and injects its path into the fs */
// TODO path needs to have a trailing slash
#define MOUNT(path, impl) \
	if (!fork2_n_mount(path)) {_klogf("impl %s", path); impl;} \
	if (!fork2_n_mount("/"))  {_klogf("dir for %s", path); fs_dir_inject(path);}