diff options
author | Kaimakan71 <undefined.foss@gmail.com> | 2024-04-28 08:11:25 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-04-28 10:09:46 -0400 |
commit | 8c79b2127ac9a4f5ceec8f5003021e38bffb177e (patch) | |
tree | 6abca80617c39e791e7e91bbec963f9596272dc8 /sys/kern | |
parent | 002cd9e8d37dd9cc20c32f916780fce611797852 (diff) |
kernel: vfs: Pass source vnode to vfsops.init()
Signed-off-by: Kaimakan71 <undefined.foss@gmail.com>
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_init.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 8b0b119..fa20af3 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -78,7 +78,7 @@ vfs_init(void) __assert(vfsops->init != NULL); __assert(vfs_mount(info->name, 0, info) == 0); - vfsops->init(info); + vfsops->init(info, NULL); } g_root_vnode->vops = &g_initramfs_vops; diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 25ad17d..27d0ec3 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -65,6 +65,7 @@ static int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data) { + struct vnode *source_vnode; struct fs_info *info; int status; @@ -79,13 +80,14 @@ mount(const char *source, const char *target, const char *filesystemtype, if (mountflags != 0) return -EINVAL; - /* - * Locate source. - * - * XXX: Only "none" is currently supported. - */ - if (strcmp(source, "none") != 0) - return -ENOENT; + /* Locate source, if any */ + if (strcmp(source, "none") == 0) { + source_vnode = NULL; + } else { + status = vfs_path_to_node(source, &source_vnode); + if (status != 0) + return status; + } /* Locate filesystem */ info = vfs_byname(filesystemtype); @@ -99,7 +101,7 @@ mount(const char *source, const char *target, const char *filesystemtype, /* Initialize filesystem if needed */ if (info->vfsops->init != NULL) - return info->vfsops->init(info); + return info->vfsops->init(info, source_vnode); return 0; } |