aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-10-29 15:13:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:13 -0500
commit9bec101a0c38d559a8c95b44d850cd09a7b4edef (patch)
tree65161628aae7438635f183a6d070887a55033952
parent00d2666623368ffd39afc875ff8a2eead2a0436c (diff)
kset: convert gfs2 to use kset_create
Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/gfs2/sys.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index a0bdc4a3acf9..44cfaae92e76 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -221,7 +221,7 @@ static struct kobj_type gfs2_ktype = {
221 .sysfs_ops = &gfs2_attr_ops, 221 .sysfs_ops = &gfs2_attr_ops,
222}; 222};
223 223
224static struct kset gfs2_kset; 224static struct kset *gfs2_kset;
225 225
226/* 226/*
227 * display struct lm_lockstruct fields 227 * display struct lm_lockstruct fields
@@ -493,7 +493,7 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
493{ 493{
494 int error; 494 int error;
495 495
496 sdp->sd_kobj.kset = &gfs2_kset; 496 sdp->sd_kobj.kset = gfs2_kset;
497 sdp->sd_kobj.ktype = &gfs2_ktype; 497 sdp->sd_kobj.ktype = &gfs2_ktype;
498 498
499 error = kobject_set_name(&sdp->sd_kobj, "%s", sdp->sd_table_name); 499 error = kobject_set_name(&sdp->sd_kobj, "%s", sdp->sd_table_name);
@@ -548,14 +548,15 @@ int gfs2_sys_init(void)
548{ 548{
549 gfs2_sys_margs = NULL; 549 gfs2_sys_margs = NULL;
550 spin_lock_init(&gfs2_sys_margs_lock); 550 spin_lock_init(&gfs2_sys_margs_lock);
551 kobject_set_name(&gfs2_kset.kobj, "gfs2"); 551 gfs2_kset = kset_create_and_add("gfs2", NULL, fs_kobj);
552 gfs2_kset.kobj.parent = fs_kobj; 552 if (!gfs2_kset)
553 return kset_register(&gfs2_kset); 553 return -ENOMEM;
554 return 0;
554} 555}
555 556
556void gfs2_sys_uninit(void) 557void gfs2_sys_uninit(void)
557{ 558{
558 kfree(gfs2_sys_margs); 559 kfree(gfs2_sys_margs);
559 kset_unregister(&gfs2_kset); 560 kset_unregister(gfs2_kset);
560} 561}
561 562