diff options
Diffstat (limited to 'src/kernel/vfs/mount.c')
-rw-r--r-- | src/kernel/vfs/mount.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/kernel/vfs/mount.c b/src/kernel/vfs/mount.c index be33b6b..bf98957 100644 --- a/src/kernel/vfs/mount.c +++ b/src/kernel/vfs/mount.c @@ -1,4 +1,5 @@ #include <kernel/mem.h> +#include <kernel/util.h> #include <kernel/vfs/mount.h> struct vfs_mount *vfs_mount_seed(void) { @@ -13,3 +14,15 @@ struct vfs_mount *vfs_mount_seed(void) { }; return mount; } + +struct vfs_mount *vfs_mount_resolve( + struct vfs_mount *top, const char *path, size_t path_len) +{ + for (; top; top = top->prev) { + if (top->prefix_len > path_len) + continue; + if (memcmp(top->prefix, path, top->prefix_len) == 0) + break; + } + return top; +} |