aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 84f9f7dfdf5b..e5e80d1a4687 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -744,9 +744,6 @@ static inline void unregister_fuseblk(void)
744} 744}
745#endif 745#endif
746 746
747static decl_subsys(fuse, NULL, NULL);
748static decl_subsys(connections, NULL, NULL);
749
750static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo) 747static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo)
751{ 748{
752 struct inode * inode = foo; 749 struct inode * inode = foo;
@@ -791,32 +788,37 @@ static void fuse_fs_cleanup(void)
791 kmem_cache_destroy(fuse_inode_cachep); 788 kmem_cache_destroy(fuse_inode_cachep);
792} 789}
793 790
791static struct kobject *fuse_kobj;
792static struct kobject *connections_kobj;
793
794static int fuse_sysfs_init(void) 794static int fuse_sysfs_init(void)
795{ 795{
796 int err; 796 int err;
797 797
798 kobj_set_kset_s(&fuse_subsys, fs_subsys); 798 fuse_kobj = kobject_create_and_add("fuse", fs_kobj);
799 err = subsystem_register(&fuse_subsys); 799 if (!fuse_kobj) {
800 if (err) 800 err = -ENOMEM;
801 goto out_err; 801 goto out_err;
802 }
802 803
803 kobj_set_kset_s(&connections_subsys, fuse_subsys); 804 connections_kobj = kobject_create_and_add("connections", fuse_kobj);
804 err = subsystem_register(&connections_subsys); 805 if (!connections_kobj) {
805 if (err) 806 err = -ENOMEM;
806 goto out_fuse_unregister; 807 goto out_fuse_unregister;
808 }
807 809
808 return 0; 810 return 0;
809 811
810 out_fuse_unregister: 812 out_fuse_unregister:
811 subsystem_unregister(&fuse_subsys); 813 kobject_put(fuse_kobj);
812 out_err: 814 out_err:
813 return err; 815 return err;
814} 816}
815 817
816static void fuse_sysfs_cleanup(void) 818static void fuse_sysfs_cleanup(void)
817{ 819{
818 subsystem_unregister(&connections_subsys); 820 kobject_put(connections_kobj);
819 subsystem_unregister(&fuse_subsys); 821 kobject_put(fuse_kobj);
820} 822}
821 823
822static int __init fuse_init(void) 824static int __init fuse_init(void)