diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2010-02-17 04:41:34 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2010-02-26 13:14:25 -0500 |
commit | b4a5d4bc377e49239374f266f0a0e2772c29749c (patch) | |
tree | dcee73fd29feb448edc4800a56214dd6266993ab /fs | |
parent | cf6620acc0f6fac57968aafef79ab372bdcf6157 (diff) |
dlm: Send lockspace name with uevents
Although it is possible to get this information from the path,
its much easier to provide the lockspace as a seperate env
variable.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dlm/lockspace.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index c010ecfc0d29..26a8bd40400a 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c | |||
@@ -191,6 +191,18 @@ static int do_uevent(struct dlm_ls *ls, int in) | |||
191 | return error; | 191 | return error; |
192 | } | 192 | } |
193 | 193 | ||
194 | static int dlm_uevent(struct kset *kset, struct kobject *kobj, | ||
195 | struct kobj_uevent_env *env) | ||
196 | { | ||
197 | struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj); | ||
198 | |||
199 | add_uevent_var(env, "LOCKSPACE=%s", ls->ls_name); | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static struct kset_uevent_ops dlm_uevent_ops = { | ||
204 | .uevent = dlm_uevent, | ||
205 | }; | ||
194 | 206 | ||
195 | int __init dlm_lockspace_init(void) | 207 | int __init dlm_lockspace_init(void) |
196 | { | 208 | { |
@@ -199,7 +211,7 @@ int __init dlm_lockspace_init(void) | |||
199 | INIT_LIST_HEAD(&lslist); | 211 | INIT_LIST_HEAD(&lslist); |
200 | spin_lock_init(&lslist_lock); | 212 | spin_lock_init(&lslist_lock); |
201 | 213 | ||
202 | dlm_kset = kset_create_and_add("dlm", NULL, kernel_kobj); | 214 | dlm_kset = kset_create_and_add("dlm", &dlm_uevent_ops, kernel_kobj); |
203 | if (!dlm_kset) { | 215 | if (!dlm_kset) { |
204 | printk(KERN_WARNING "%s: can not create kset\n", __func__); | 216 | printk(KERN_WARNING "%s: can not create kset\n", __func__); |
205 | return -ENOMEM; | 217 | return -ENOMEM; |