From a6e6702727d2fdba6e921db16feb703a859687c8 Mon Sep 17 00:00:00 2001 From: c4llv07e Date: Tue, 6 May 2025 18:24:57 +0300 Subject: Experimenting with VFS --- etcfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/etcfs.c b/etcfs.c index c88040e..82e7220 100644 --- a/etcfs.c +++ b/etcfs.c @@ -1,10 +1,21 @@ #include #include #include +#include + +static struct fs_context_operations etcfs_context_ops = { +}; + +static int etcfs_init_fs_context(struct fs_context *fc) { + int err; + fc->ops = &etcfs_context_ops; + return 0; +} static struct file_system_type etc_fs_type = { .name = "etcfs", .f_flasgs = FS_USERNS_MOUNT, + .init_fs_context = etcfs_init_fs_context, }; static int __init etcfs_init(void) { @@ -17,6 +28,11 @@ static int __init etcfs_init(void) { } static int __exit etcfs_exit(void) { + int err; + err = unregister_filesystem(etcfs); + if (err) { + return err; + } return 0; } -- cgit v1.2.3