Commit 9bec101a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 00d26666
...@@ -221,7 +221,7 @@ static struct kobj_type gfs2_ktype = { ...@@ -221,7 +221,7 @@ static struct kobj_type gfs2_ktype = {
.sysfs_ops = &gfs2_attr_ops, .sysfs_ops = &gfs2_attr_ops,
}; };
static struct kset gfs2_kset; static struct kset *gfs2_kset;
/* /*
* display struct lm_lockstruct fields * display struct lm_lockstruct fields
...@@ -493,7 +493,7 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp) ...@@ -493,7 +493,7 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
{ {
int error; int error;
sdp->sd_kobj.kset = &gfs2_kset; sdp->sd_kobj.kset = gfs2_kset;
sdp->sd_kobj.ktype = &gfs2_ktype; sdp->sd_kobj.ktype = &gfs2_ktype;
error = kobject_set_name(&sdp->sd_kobj, "%s", sdp->sd_table_name); error = kobject_set_name(&sdp->sd_kobj, "%s", sdp->sd_table_name);
...@@ -548,14 +548,15 @@ int gfs2_sys_init(void) ...@@ -548,14 +548,15 @@ int gfs2_sys_init(void)
{ {
gfs2_sys_margs = NULL; gfs2_sys_margs = NULL;
spin_lock_init(&gfs2_sys_margs_lock); spin_lock_init(&gfs2_sys_margs_lock);
kobject_set_name(&gfs2_kset.kobj, "gfs2"); gfs2_kset = kset_create_and_add("gfs2", NULL, fs_kobj);
gfs2_kset.kobj.parent = fs_kobj; if (!gfs2_kset)
return kset_register(&gfs2_kset); return -ENOMEM;
return 0;
} }
void gfs2_sys_uninit(void) void gfs2_sys_uninit(void)
{ {
kfree(gfs2_sys_margs); kfree(gfs2_sys_margs);
kset_unregister(&gfs2_kset); kset_unregister(gfs2_kset);
} }
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