aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/locking/dlm/sysfs.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index 93e66b22757f..0a8614088ec6 100644
--- a/fs/gfs2/locking/dlm/sysfs.c
+++ b/fs/gfs2/locking/dlm/sysfs.c
@@ -189,7 +189,7 @@ static struct kobj_type gdlm_ktype = {
189 .sysfs_ops = &gdlm_attr_ops, 189 .sysfs_ops = &gdlm_attr_ops,
190}; 190};
191 191
192static struct kset gdlm_kset; 192static struct kset *gdlm_kset;
193 193
194int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj) 194int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj)
195{ 195{
@@ -201,7 +201,7 @@ int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj)
201 return error; 201 return error;
202 } 202 }
203 203
204 ls->kobj.kset = &gdlm_kset; 204 ls->kobj.kset = gdlm_kset;
205 ls->kobj.ktype = &gdlm_ktype; 205 ls->kobj.ktype = &gdlm_ktype;
206 ls->kobj.parent = fskobj; 206 ls->kobj.parent = fskobj;
207 207
@@ -219,19 +219,17 @@ void gdlm_kobject_release(struct gdlm_ls *ls)
219 219
220int gdlm_sysfs_init(void) 220int gdlm_sysfs_init(void)
221{ 221{
222 int error; 222 gdlm_kset = kset_create_and_add("lock_dlm", NULL,
223 223 &kernel_subsys.kobj);
224 kobject_set_name(&gdlm_kset.kobj, "lock_dlm"); 224 if (!gdlm_kset) {
225 gdlm_kset.kobj.kset = &kernel_subsys; 225 printk(KERN_WARNING "%s: can not create kset\n", __FUNCTION__);
226 error = kset_register(&gdlm_kset); 226 return -ENOMEM;
227 if (error) 227 }
228 printk("lock_dlm: cannot register kset %d\n", error); 228 return 0;
229
230 return error;
231} 229}
232 230
233void gdlm_sysfs_exit(void) 231void gdlm_sysfs_exit(void)
234{ 232{
235 kset_unregister(&gdlm_kset); 233 kset_unregister(gdlm_kset);
236} 234}
237 235