summaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-10-29 20:13:17 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-25 05:40:13 +0100
commit917e865df7eb020f20ffc2b4204f282a587df94f (patch)
treeada1b83dd08dc2ecd1faf1f034784e822cda751a /fs/ecryptfs/main.c
parentkobject: convert configfs to use kobject_create (diff)
downloadlinux-917e865df7eb020f20ffc2b4204f282a587df94f.tar.xz
linux-917e865df7eb020f20ffc2b4204f282a587df94f.zip
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.c19
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)
return 0;
}
-static decl_subsys(ecryptfs, NULL);
+static struct kset *ecryptfs_kset;
static ssize_t version_show(struct kset *kset, char *buff)
{
@@ -798,18 +798,17 @@ static int do_sysfs_registration(void)
{
int rc;
- ecryptfs_subsys.kobj.kset = &fs_subsys;
- rc = subsystem_register(&ecryptfs_subsys);
- if (rc) {
- printk(KERN_ERR
- "Unable to register ecryptfs sysfs subsystem\n");
+ ecryptfs_kset = kset_create_and_add("ecryptfs", NULL, &fs_subsys.kobj);
+ if (!ecryptfs_kset) {
+ printk(KERN_ERR "Unable to create ecryptfs kset\n");
+ rc = -ENOMEM;
goto out;
}
- rc = sysfs_create_group(&ecryptfs_subsys.kobj, &attr_group);
+ rc = sysfs_create_group(&ecryptfs_kset->kobj, &attr_group);
if (rc) {
printk(KERN_ERR
"Unable to create ecryptfs version attributes\n");
- subsystem_unregister(&ecryptfs_subsys);
+ kset_unregister(ecryptfs_kset);
}
out:
return rc;
@@ -817,8 +816,8 @@ out:
static void do_sysfs_unregistration(void)
{
- sysfs_remove_group(&ecryptfs_subsys.kobj, &attr_group);
- subsystem_unregister(&ecryptfs_subsys);
+ sysfs_remove_group(&ecryptfs_kset->kobj, &attr_group);
+ kset_unregister(ecryptfs_kset);
}
static int __init ecryptfs_init(void)