diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-29 15:13:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:14 -0500 |
commit | d405936b322220dc5cca9d2b58ef1911ae8efec9 (patch) | |
tree | e902e490ff92e45305ad910c7075b846bb1b84ca /fs/dlm/lockspace.c | |
parent | 136a27507fd09006973f11b17ca971d4c176a06a (diff) |
kset: convert dlm 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>
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r-- | fs/dlm/lockspace.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index 18e4a17b9be..83a9c4dd511 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c | |||
@@ -166,7 +166,7 @@ static struct kobj_type dlm_ktype = { | |||
166 | .release = lockspace_kobj_release, | 166 | .release = lockspace_kobj_release, |
167 | }; | 167 | }; |
168 | 168 | ||
169 | static struct kset dlm_kset; | 169 | static struct kset *dlm_kset; |
170 | 170 | ||
171 | static int kobject_setup(struct dlm_ls *ls) | 171 | static int kobject_setup(struct dlm_ls *ls) |
172 | { | 172 | { |
@@ -180,7 +180,7 @@ static int kobject_setup(struct dlm_ls *ls) | |||
180 | if (error) | 180 | if (error) |
181 | return error; | 181 | return error; |
182 | 182 | ||
183 | ls->ls_kobj.kset = &dlm_kset; | 183 | ls->ls_kobj.kset = dlm_kset; |
184 | ls->ls_kobj.ktype = &dlm_ktype; | 184 | ls->ls_kobj.ktype = &dlm_ktype; |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
@@ -218,24 +218,22 @@ static int do_uevent(struct dlm_ls *ls, int in) | |||
218 | 218 | ||
219 | int dlm_lockspace_init(void) | 219 | int dlm_lockspace_init(void) |
220 | { | 220 | { |
221 | int error; | ||
222 | |||
223 | ls_count = 0; | 221 | ls_count = 0; |
224 | mutex_init(&ls_lock); | 222 | mutex_init(&ls_lock); |
225 | INIT_LIST_HEAD(&lslist); | 223 | INIT_LIST_HEAD(&lslist); |
226 | spin_lock_init(&lslist_lock); | 224 | spin_lock_init(&lslist_lock); |
227 | 225 | ||
228 | kobject_set_name(&dlm_kset.kobj, "dlm"); | 226 | dlm_kset = kset_create_and_add("dlm", NULL, &kernel_subsys.kobj); |
229 | dlm_kset.kobj.kset = &kernel_subsys; | 227 | if (!dlm_kset) { |
230 | error = kset_register(&dlm_kset); | 228 | printk(KERN_WARNING "%s: can not create kset\n", __FUNCTION__); |
231 | if (error) | 229 | return -ENOMEM; |
232 | printk("dlm_lockspace_init: cannot register kset %d\n", error); | 230 | } |
233 | return error; | 231 | return 0; |
234 | } | 232 | } |
235 | 233 | ||
236 | void dlm_lockspace_exit(void) | 234 | void dlm_lockspace_exit(void) |
237 | { | 235 | { |
238 | kset_unregister(&dlm_kset); | 236 | kset_unregister(dlm_kset); |
239 | } | 237 | } |
240 | 238 | ||
241 | static int dlm_scand(void *data) | 239 | static int dlm_scand(void *data) |