From 1ca3f322c81544ba769a0cd44fbd4bf03a8f875d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 16 Jan 2021 14:19:43 +0100 Subject: Fixed vfs dev finder --- kernel/features/fs.c | 2 ++ kernel/inc/fs.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'kernel') diff --git a/kernel/features/fs.c b/kernel/features/fs.c index 45e744c..48e736a 100644 --- a/kernel/features/fs.c +++ b/kernel/features/fs.c @@ -70,6 +70,8 @@ struct device *vfs_find_dev(const char *path) { assert(path[0] == '/'); struct mount_info *m = vfs_find_mount_info(path); + if (m->dev->vfs->type == VFS_DEVFS) // TODO: ? + return device_get_by_name(path + strlen(m->path) + 1); return m && m->dev ? m->dev : NULL; } diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h index e5c444c..64db881 100644 --- a/kernel/inc/fs.h +++ b/kernel/inc/fs.h @@ -59,6 +59,8 @@ u32 vfs_write(const char *path, void *buf, u32 offset, u32 count); u32 vfs_stat(const char *path, struct stat *buf); u32 vfs_ready(const char *path); +struct device *device_get_by_name(const char *name); + /** * EXT2 */ -- cgit v1.2.3