[PATCH 1/13] Filesystem in Userspace
From: Miklos Szeredi
Date: Sat Nov 20 2004 - 18:22:31 EST
This patch adds an empty /sys/fs, which filesystems can use.
Signed-off-by: Miklos Szeredi <miklos@xxxxxxxxxx>
diff -ru linux-2.6.10-rc2.orig/fs/filesystems.c linux-2.6.10-rc2/fs/filesystems.c
--- linux-2.6.10-rc2.orig/fs/filesystems.c 2004-11-17 17:33:26.000000000 +0100
+++ linux-2.6.10-rc2/fs/filesystems.c 2004-11-18 14:34:07.000000000 +0100
@@ -29,6 +29,7 @@
static struct file_system_type *file_systems;
static rwlock_t file_systems_lock = RW_LOCK_UNLOCKED;
+static decl_subsys(fs, NULL, NULL);
/* WARNING: This can be used only if we _already_ own a reference */
void get_filesystem(struct file_system_type *fs)
@@ -234,3 +235,17 @@
}
EXPORT_SYMBOL(get_fs_type);
+
+int fs_subsys_register(struct subsystem *sub)
+{
+ kset_set_kset_s(sub, fs_subsys);
+ return subsystem_register(sub);
+}
+
+EXPORT_SYMBOL(fs_subsys_register);
+
+int __init fs_subsys_init(void)
+{
+ /* register fs_subsys */
+ return subsystem_register(&fs_subsys);
+}
diff -ru linux-2.6.10-rc2.orig/fs/namespace.c linux-2.6.10-rc2/fs/namespace.c
--- linux-2.6.10-rc2.orig/fs/namespace.c 2004-11-17 17:33:28.000000000 +0100
+++ linux-2.6.10-rc2/fs/namespace.c 2004-11-18 14:39:21.000000000 +0100
@@ -26,6 +26,7 @@
#include <asm/unistd.h>
extern int __init init_rootfs(void);
+extern int __init fs_subsys_init(void);
#ifdef CONFIG_SYSFS
extern int __init sysfs_init(void);
@@ -1436,6 +1437,7 @@
i--;
} while (i);
sysfs_init();
+ fs_subsys_init();
init_rootfs();
init_mount_tree();
}
diff -ru linux-2.6.10-rc2.orig/include/linux/fs.h linux-2.6.10-rc2/include/linux/fs.h
--- linux-2.6.10-rc2.orig/include/linux/fs.h 2004-11-17 17:33:46.000000000 +0100
+++ linux-2.6.10-rc2/include/linux/fs.h 2004-11-18 14:19:19.000000000 +0100
@@ -1185,6 +1185,9 @@
extern int vfs_statfs(struct super_block *, struct kstatfs *);
+/* Register filesystem specific subsystem under /sys/fs */
+extern int fs_subsys_register(struct subsystem *sub);
+
/* Return value for VFS lock functions - tells locks.c to lock conventionally
* REALLY kosha for root NFS and nfs_lock
*/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/