From 9600d3df3e1b75cff0e3ecd20ae3ca2fe393eb8b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 21 Nov 2025 13:59:34 -0500 Subject: 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 --- sys/fs/tmpfs.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'sys/fs') diff --git a/sys/fs/tmpfs.c b/sys/fs/tmpfs.c index cb18b6b..5ac69b1 100644 --- a/sys/fs/tmpfs.c +++ b/sys/fs/tmpfs.c @@ -34,7 +34,20 @@ * Mount a filesystem */ static int -tmpfs_mount(struct fs_info *fip, void *data) +tmpfs_mount(struct fs_info *fip, struct mount *mp) +{ + int error; + + error = vnode_init(&mp->vp, VDIR); + if (error < 0) { + return error; + } + + return 0; +} + +static int +tmpfs_init(struct fs_info *fip) { struct mount_args mountargs; int error; @@ -50,5 +63,6 @@ tmpfs_mount(struct fs_info *fip, void *data) } struct vfsops g_tmpfs_ops = { - .mount = tmpfs_mount + .mount = tmpfs_mount, + .init = tmpfs_init }; -- cgit v1.2.3