linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/13] Filesystem in Userspace
@ 2004-11-20 23:08 Miklos Szeredi
  2004-11-22 17:19 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2004-11-20 23:08 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: linux-fsdevel, linux-kernel

This patch adds an empty /sys/fs, which filesystems can use.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
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
  */ 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/13] Filesystem in Userspace
  2004-11-20 23:08 [PATCH 1/13] Filesystem in Userspace Miklos Szeredi
@ 2004-11-22 17:19 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-11-22 17:19 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: akpm, torvalds, linux-fsdevel, linux-kernel

On Sun, Nov 21, 2004 at 12:08:59AM +0100, Miklos Szeredi wrote:
> This patch adds an empty /sys/fs, which filesystems can use.
> 
> Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
> 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);

Just make this global and export it.  That way you can then get rid of
this code:

> +int fs_subsys_register(struct subsystem *sub)
> +{
> +	kset_set_kset_s(sub, fs_subsys);
> +	return subsystem_register(sub);
> +}
> +
> +EXPORT_SYMBOL(fs_subsys_register);

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-22 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-20 23:08 [PATCH 1/13] Filesystem in Userspace Miklos Szeredi
2004-11-22 17:19 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).