summaryrefslogtreecommitdiff
path: root/etcfs.c
diff options
context:
space:
mode:
authorc4llv07e <igor@c4llv07e.xyz>2025-05-06 18:24:57 +0300
committerc4llv07e <igor@c4llv07e.xyz>2025-05-06 18:24:57 +0300
commita6e6702727d2fdba6e921db16feb703a859687c8 (patch)
tree9ea84973b65cf7adc4819665bc47740c4274b9ea /etcfs.c
parent352bea70e563ecfb2034f09faf03a43102c0dbf7 (diff)
downloadetcfs-a6e6702727d2fdba6e921db16feb703a859687c8.tar.gz
etcfs-a6e6702727d2fdba6e921db16feb703a859687c8.tar.bz2
etcfs-a6e6702727d2fdba6e921db16feb703a859687c8.zip
Experimenting with VFS
Diffstat (limited to 'etcfs.c')
-rw-r--r--etcfs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/etcfs.c b/etcfs.c
index c88040e..82e7220 100644
--- a/etcfs.c
+++ b/etcfs.c
@@ -1,10 +1,21 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
+#include <linux/fs_context.h>
+
+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;
}