Commit 917e865d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3794491d
...@@ -734,7 +734,7 @@ static int ecryptfs_init_kmem_caches(void) ...@@ -734,7 +734,7 @@ static int ecryptfs_init_kmem_caches(void)
return 0; return 0;
} }
static decl_subsys(ecryptfs, NULL); static struct kset *ecryptfs_kset;
static ssize_t version_show(struct kset *kset, char *buff) static ssize_t version_show(struct kset *kset, char *buff)
{ {
...@@ -798,18 +798,17 @@ static int do_sysfs_registration(void) ...@@ -798,18 +798,17 @@ static int do_sysfs_registration(void)
{ {
int rc; int rc;
ecryptfs_subsys.kobj.kset = &fs_subsys; ecryptfs_kset = kset_create_and_add("ecryptfs", NULL, &fs_subsys.kobj);
rc = subsystem_register(&ecryptfs_subsys); if (!ecryptfs_kset) {
if (rc) { printk(KERN_ERR "Unable to create ecryptfs kset\n");
printk(KERN_ERR rc = -ENOMEM;
"Unable to register ecryptfs sysfs subsystem\n");
goto out; goto out;
} }
rc = sysfs_create_group(&ecryptfs_subsys.kobj, &attr_group); rc = sysfs_create_group(&ecryptfs_kset->kobj, &attr_group);
if (rc) { if (rc) {
printk(KERN_ERR printk(KERN_ERR
"Unable to create ecryptfs version attributes\n"); "Unable to create ecryptfs version attributes\n");
subsystem_unregister(&ecryptfs_subsys); kset_unregister(ecryptfs_kset);
} }
out: out:
return rc; return rc;
...@@ -817,8 +816,8 @@ out: ...@@ -817,8 +816,8 @@ out:
static void do_sysfs_unregistration(void) static void do_sysfs_unregistration(void)
{ {
sysfs_remove_group(&ecryptfs_subsys.kobj, &attr_group); sysfs_remove_group(&ecryptfs_kset->kobj, &attr_group);
subsystem_unregister(&ecryptfs_subsys); kset_unregister(ecryptfs_kset);
} }
static int __init ecryptfs_init(void) static int __init ecryptfs_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment