aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/dlm/sysfs.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-17 14:54:39 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:26 -0500
commit901195ed7f4b2f30dc5a36271887939c5d7bfb9f (patch)
tree1d56af3b3484ba97a98e3649247da25ac289ec7b /fs/gfs2/locking/dlm/sysfs.c
parent43b98c4a66760d18d4056beed4078a8dbad193cc (diff)
Kobject: change GFS2 to use kobject_init_and_add
Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/gfs2/locking/dlm/sysfs.c')
-rw-r--r--fs/gfs2/locking/dlm/sysfs.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index e5a4fbf7265f..a7336b909c61 100644
--- a/fs/gfs2/locking/dlm/sysfs.c
+++ b/fs/gfs2/locking/dlm/sysfs.c
@@ -195,19 +195,12 @@ int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj)
195{ 195{
196 int error; 196 int error;
197 197
198 error = kobject_set_name(&ls->kobj, "%s", "lock_module");
199 if (error) {
200 log_error("can't set kobj name %d", error);
201 return error;
202 }
203
204 ls->kobj.kset = gdlm_kset; 198 ls->kobj.kset = gdlm_kset;
205 ls->kobj.ktype = &gdlm_ktype; 199 error = kobject_init_and_add(&ls->kobj, &gdlm_ktype, fskobj,
206 ls->kobj.parent = fskobj; 200 "lock_module");
207
208 error = kobject_register(&ls->kobj);
209 if (error) 201 if (error)
210 log_error("can't register kobj %d", error); 202 log_error("can't register kobj %d", error);
203 kobject_uevent(&ls->kobj, KOBJ_ADD);
211 204
212 return error; 205 return error;
213} 206}