diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-29 15:13:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:13 -0500 |
commit | 917e865df7eb020f20ffc2b4204f282a587df94f (patch) | |
tree | ada1b83dd08dc2ecd1faf1f034784e822cda751a /fs/ecryptfs/main.c | |
parent | 3794491d0c4b6355c55b0379f003900e57666a97 (diff) |
kset: convert ecryptfs to use kset_create
Dynamically create the kset instead of declaring it statically.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mike Halcrow <mhalcrow@us.ibm.com>
Cc: Phillip Hellewell <phillip@hellewell.homeip.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r-- | fs/ecryptfs/main.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index fe2f44fa17cc..4750d82c3db9 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -734,7 +734,7 @@ static int ecryptfs_init_kmem_caches(void) | |||
734 | return 0; | 734 | return 0; |
735 | } | 735 | } |
736 | 736 | ||
737 | static decl_subsys(ecryptfs, NULL); | 737 | static struct kset *ecryptfs_kset; |
738 | 738 | ||
739 | static ssize_t version_show(struct kset *kset, char *buff) | 739 | static ssize_t version_show(struct kset *kset, char *buff) |
740 | { | 740 | { |
@@ -798,18 +798,17 @@ static int do_sysfs_registration(void) | |||
798 | { | 798 | { |
799 | int rc; | 799 | int rc; |
800 | 800 | ||
801 | ecryptfs_subsys.kobj.kset = &fs_subsys; | 801 | ecryptfs_kset = kset_create_and_add("ecryptfs", NULL, &fs_subsys.kobj); |
802 | rc = subsystem_register(&ecryptfs_subsys); | 802 | if (!ecryptfs_kset) { |
803 | if (rc) { | 803 | printk(KERN_ERR "Unable to create ecryptfs kset\n"); |
804 | printk(KERN_ERR | 804 | rc = -ENOMEM; |
805 | "Unable to register ecryptfs sysfs subsystem\n"); | ||
806 | goto out; | 805 | goto out; |
807 | } | 806 | } |
808 | rc = sysfs_create_group(&ecryptfs_subsys.kobj, &attr_group); | 807 | rc = sysfs_create_group(&ecryptfs_kset->kobj, &attr_group); |
809 | if (rc) { | 808 | if (rc) { |
810 | printk(KERN_ERR | 809 | printk(KERN_ERR |
811 | "Unable to create ecryptfs version attributes\n"); | 810 | "Unable to create ecryptfs version attributes\n"); |
812 | subsystem_unregister(&ecryptfs_subsys); | 811 | kset_unregister(ecryptfs_kset); |
813 | } | 812 | } |
814 | out: | 813 | out: |
815 | return rc; | 814 | return rc; |
@@ -817,8 +816,8 @@ out: | |||
817 | 816 | ||
818 | static void do_sysfs_unregistration(void) | 817 | static void do_sysfs_unregistration(void) |
819 | { | 818 | { |
820 | sysfs_remove_group(&ecryptfs_subsys.kobj, &attr_group); | 819 | sysfs_remove_group(&ecryptfs_kset->kobj, &attr_group); |
821 | subsystem_unregister(&ecryptfs_subsys); | 820 | kset_unregister(ecryptfs_kset); |
822 | } | 821 | } |
823 | 822 | ||
824 | static int __init ecryptfs_init(void) | 823 | static int __init ecryptfs_init(void) |