diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-21 13:59:34 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-21 13:59:34 -0500 |
| commit | 9600d3df3e1b75cff0e3ecd20ae3ca2fe393eb8b (patch) | |
| tree | 9e93670ab016c8e60d4e8894b8cf7e9154398734 /sys/kern/vfs_mount.c | |
| parent | 794b3671ed636c4fb8a74e1cf3a636272d4fa3d9 (diff) | |
kern: vfs: Decouple mounting from initialization
Upon bootup, all filesystems are to be enumerated and initialized before
they are mounted. Some filesystems may decide to mount themselves right
away. However, it is crucial to keep mounting and initialization
seperate.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/vfs_mount.c')
| -rw-r--r-- | sys/kern/vfs_mount.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 51a464a..39f98d2 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -74,6 +74,7 @@ int mount(struct mount_args *margs) { struct fs_info *fip; + struct vfsops *vfsops; struct mount *mp; int error; @@ -95,13 +96,18 @@ mount(struct mount_args *margs) return error; } + vfsops = fip->vfsops; + if (vfsops->mount == NULL) { + return -ENOTSUP; + } + mp = kalloc(sizeof(*mp)); if (mp == NULL) { return -ENOMEM; } mp->fip = fip; - error = vnode_init(&mp->vp, VDIR); + error = vfsops->mount(fip, mp); if (error < 0) { kfree(mp); return error; |
