diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-29 20:13:17 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 20:40:11 -0800 |
commit | 5c89e17e9c2bc03ed16320967832b33b174e6234 (patch) | |
tree | 85d55af251e2d3f32448781d31317508f92aca4d | |
parent | 43968d2f1648f4dc92437dc0363a3e88377445b3 (diff) | |
download | linux-stable-5c89e17e9c2bc03ed16320967832b33b174e6234.tar.gz linux-stable-5c89e17e9c2bc03ed16320967832b33b174e6234.tar.bz2 linux-stable-5c89e17e9c2bc03ed16320967832b33b174e6234.zip |
kobject: convert fuse to use kobject_create
We don't need a kset here, a simple kobject will do just fine, so
dynamically create the kobject and use it.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | fs/fuse/inode.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index f5e4182c482e..92118066f1d6 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -744,9 +744,6 @@ static inline void unregister_fuseblk(void) } #endif -static decl_subsys(fuse, NULL); -static decl_subsys(connections, NULL); - static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo) { struct inode * inode = foo; @@ -791,32 +788,37 @@ static void fuse_fs_cleanup(void) kmem_cache_destroy(fuse_inode_cachep); } +static struct kobject *fuse_kobj; +static struct kobject *connections_kobj; + static int fuse_sysfs_init(void) { int err; - fuse_subsys.kobj.kset = &fs_subsys; - err = subsystem_register(&fuse_subsys); - if (err) + fuse_kobj = kobject_create_and_add("fuse", &fs_subsys.kobj); + if (!fuse_kobj) { + err = -ENOMEM; goto out_err; + } - connections_subsys.kobj.kset = &fuse_subsys; - err = subsystem_register(&connections_subsys); - if (err) + connections_kobj = kobject_create_and_add("connections", fuse_kobj); + if (!connections_kobj) { + err = -ENOMEM; goto out_fuse_unregister; + } return 0; out_fuse_unregister: - subsystem_unregister(&fuse_subsys); + kobject_unregister(fuse_kobj); out_err: return err; } static void fuse_sysfs_cleanup(void) { - subsystem_unregister(&connections_subsys); - subsystem_unregister(&fuse_subsys); + kobject_unregister(connections_kobj); + kobject_unregister(fuse_kobj); } static int __init fuse_init(void) |