forked from Minki/linux
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>
This commit is contained in:
parent
43968d2f16
commit
5c89e17e9c
@ -744,9 +744,6 @@ static inline void unregister_fuseblk(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static decl_subsys(fuse, NULL);
|
|
||||||
static decl_subsys(connections, NULL);
|
|
||||||
|
|
||||||
static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo)
|
static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo)
|
||||||
{
|
{
|
||||||
struct inode * inode = foo;
|
struct inode * inode = foo;
|
||||||
@ -791,32 +788,37 @@ static void fuse_fs_cleanup(void)
|
|||||||
kmem_cache_destroy(fuse_inode_cachep);
|
kmem_cache_destroy(fuse_inode_cachep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct kobject *fuse_kobj;
|
||||||
|
static struct kobject *connections_kobj;
|
||||||
|
|
||||||
static int fuse_sysfs_init(void)
|
static int fuse_sysfs_init(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
fuse_subsys.kobj.kset = &fs_subsys;
|
fuse_kobj = kobject_create_and_add("fuse", &fs_subsys.kobj);
|
||||||
err = subsystem_register(&fuse_subsys);
|
if (!fuse_kobj) {
|
||||||
if (err)
|
err = -ENOMEM;
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
}
|
||||||
|
|
||||||
connections_subsys.kobj.kset = &fuse_subsys;
|
connections_kobj = kobject_create_and_add("connections", fuse_kobj);
|
||||||
err = subsystem_register(&connections_subsys);
|
if (!connections_kobj) {
|
||||||
if (err)
|
err = -ENOMEM;
|
||||||
goto out_fuse_unregister;
|
goto out_fuse_unregister;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_fuse_unregister:
|
out_fuse_unregister:
|
||||||
subsystem_unregister(&fuse_subsys);
|
kobject_unregister(fuse_kobj);
|
||||||
out_err:
|
out_err:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fuse_sysfs_cleanup(void)
|
static void fuse_sysfs_cleanup(void)
|
||||||
{
|
{
|
||||||
subsystem_unregister(&connections_subsys);
|
kobject_unregister(connections_kobj);
|
||||||
subsystem_unregister(&fuse_subsys);
|
kobject_unregister(fuse_kobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init fuse_init(void)
|
static int __init fuse_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user