aboutsummaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/locking/dlm/sysfs.c13
-rw-r--r--fs/gfs2/sys.c10
2 files changed, 6 insertions, 17 deletions
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index e5a4fbf7265..a7336b909c6 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)
{
int error;
- error = kobject_set_name(&ls->kobj, "%s", "lock_module");
- if (error) {
- log_error("can't set kobj name %d", error);
- return error;
- }
-
ls->kobj.kset = gdlm_kset;
- ls->kobj.ktype = &gdlm_ktype;
- ls->kobj.parent = fskobj;
-
- error = kobject_register(&ls->kobj);
+ error = kobject_init_and_add(&ls->kobj, &gdlm_ktype, fskobj,
+ "lock_module");
if (error)
log_error("can't register kobj %d", error);
+ kobject_uevent(&ls->kobj, KOBJ_ADD);
return error;
}
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 44cfaae92e7..8d9cd5bd584 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -494,13 +494,8 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
int error;
sdp->sd_kobj.kset = gfs2_kset;
- sdp->sd_kobj.ktype = &gfs2_ktype;
-
- error = kobject_set_name(&sdp->sd_kobj, "%s", sdp->sd_table_name);
- if (error)
- goto fail;
-
- error = kobject_register(&sdp->sd_kobj);
+ error = kobject_init_and_add(&sdp->sd_kobj, &gfs2_ktype, NULL,
+ "%s", sdp->sd_table_name);
if (error)
goto fail;
@@ -520,6 +515,7 @@ int gfs2_sys_fs_add(struct gfs2_sbd *sdp)
if (error)
goto fail_args;
+ kobject_uevent(&sdp->sd_kobj, KOBJ_ADD);
return 0;
fail_args: