|
|
@@ -1,7 +1,9 @@
|
|
|
#include <linux/module.h>
|
|
|
#include <linux/kernel.h>
|
|
|
+#include <linux/init.h>
|
|
|
+#include <linux/fs.h>
|
|
|
|
|
|
-#include "src/butterfly.h"
|
|
|
+#include "butterfly.h"
|
|
|
|
|
|
static struct file_system_type butterfly_fs = {
|
|
|
.owner = THIS_MODULE,
|
|
|
@@ -12,13 +14,31 @@ static struct file_system_type butterfly_fs = {
|
|
|
.kill_sb = butterfly_unmount
|
|
|
};
|
|
|
|
|
|
-int init_module()
|
|
|
+struct dentry *butterfly_mount(
|
|
|
+ struct file_system_type *fs,
|
|
|
+ int flags,
|
|
|
+ const char *devname,
|
|
|
+ void *data)
|
|
|
{
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+void butterfly_unmount(struct super_block *sb)
|
|
|
+{
|
|
|
+ kill_block_super(sb);
|
|
|
+}
|
|
|
+
|
|
|
+static int __init butterfly_init(void)
|
|
|
+{
|
|
|
+ printk(KERN_INFO "INIT");
|
|
|
return register_filesystem(&butterfly_fs);
|
|
|
}
|
|
|
|
|
|
-void cleanup_module()
|
|
|
+static void __exit butterfly_cleanup(void)
|
|
|
{
|
|
|
unregister_filesystem(&butterfly_fs);
|
|
|
}
|
|
|
|
|
|
+module_init(butterfly_init);
|
|
|
+module_exit(butterfly_cleanup);
|
|
|
+
|