summaryrefslogtreecommitdiff
path: root/sys/fs/tmpfs.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-11-21 13:59:34 -0500
committerIan Moffett <ian@osmora.org>2025-11-21 13:59:34 -0500
commit9600d3df3e1b75cff0e3ecd20ae3ca2fe393eb8b (patch)
tree9e93670ab016c8e60d4e8894b8cf7e9154398734 /sys/fs/tmpfs.c
parent794b3671ed636c4fb8a74e1cf3a636272d4fa3d9 (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/fs/tmpfs.c')
-rw-r--r--sys/fs/tmpfs.c18
1 files changed, 16 insertions, 2 deletions
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
};