diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-11-26 05:26:38 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-01-05 02:39:10 -0500 |
commit | fdd1062ebaa422c5684f97fa91da06f91167d76b (patch) | |
tree | 30ca8542e238bb04f4d80c8e009fa446ff66341b /fs | |
parent | 97cc1025b1a91c52e84f12478dcf0f853abc6564 (diff) |
GFS2: Send some sensible sysfs stuff
We ought to inform the user of the locktable and lockproto for each
uevent we generate.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/locking/dlm/sysfs.c | 16 | ||||
-rw-r--r-- | fs/gfs2/sys.c | 16 |
2 files changed, 30 insertions, 2 deletions
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c index 4ec571c3d8a9..9b7edcf7bd49 100644 --- a/fs/gfs2/locking/dlm/sysfs.c +++ b/fs/gfs2/locking/dlm/sysfs.c | |||
@@ -195,9 +195,23 @@ void gdlm_kobject_release(struct gdlm_ls *ls) | |||
195 | kobject_put(&ls->kobj); | 195 | kobject_put(&ls->kobj); |
196 | } | 196 | } |
197 | 197 | ||
198 | static int gdlm_uevent(struct kset *kset, struct kobject *kobj, | ||
199 | struct kobj_uevent_env *env) | ||
200 | { | ||
201 | struct gdlm_ls *ls = container_of(kobj, struct gdlm_ls, kobj); | ||
202 | add_uevent_var(env, "LOCKTABLE=%s:%s", ls->clustername, ls->fsname); | ||
203 | add_uevent_var(env, "LOCKPROTO=lock_dlm"); | ||
204 | return 0; | ||
205 | } | ||
206 | |||
207 | static struct kset_uevent_ops gdlm_uevent_ops = { | ||
208 | .uevent = gdlm_uevent, | ||
209 | }; | ||
210 | |||
211 | |||
198 | int gdlm_sysfs_init(void) | 212 | int gdlm_sysfs_init(void) |
199 | { | 213 | { |
200 | gdlm_kset = kset_create_and_add("lock_dlm", NULL, kernel_kobj); | 214 | gdlm_kset = kset_create_and_add("lock_dlm", &gdlm_uevent_ops, kernel_kobj); |
201 | if (!gdlm_kset) { | 215 | if (!gdlm_kset) { |
202 | printk(KERN_WARNING "%s: can not create kset\n", __func__); | 216 | printk(KERN_WARNING "%s: can not create kset\n", __func__); |
203 | return -ENOMEM; | 217 | return -ENOMEM; |
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 67ba5b7b759b..298bcb6c2713 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
@@ -461,11 +461,25 @@ void gfs2_sys_fs_del(struct gfs2_sbd *sdp) | |||
461 | kobject_put(&sdp->sd_kobj); | 461 | kobject_put(&sdp->sd_kobj); |
462 | } | 462 | } |
463 | 463 | ||
464 | static int gfs2_uevent(struct kset *kset, struct kobject *kobj, | ||
465 | struct kobj_uevent_env *env) | ||
466 | { | ||
467 | struct gfs2_sbd *sdp = container_of(kobj, struct gfs2_sbd, sd_kobj); | ||
468 | add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); | ||
469 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); | ||
470 | return 0; | ||
471 | } | ||
472 | |||
473 | static struct kset_uevent_ops gfs2_uevent_ops = { | ||
474 | .uevent = gfs2_uevent, | ||
475 | }; | ||
476 | |||
477 | |||
464 | int gfs2_sys_init(void) | 478 | int gfs2_sys_init(void) |
465 | { | 479 | { |
466 | gfs2_sys_margs = NULL; | 480 | gfs2_sys_margs = NULL; |
467 | spin_lock_init(&gfs2_sys_margs_lock); | 481 | spin_lock_init(&gfs2_sys_margs_lock); |
468 | gfs2_kset = kset_create_and_add("gfs2", NULL, fs_kobj); | 482 | gfs2_kset = kset_create_and_add("gfs2", &gfs2_uevent_ops, fs_kobj); |
469 | if (!gfs2_kset) | 483 | if (!gfs2_kset) |
470 | return -ENOMEM; | 484 | return -ENOMEM; |
471 | return 0; | 485 | return 0; |