From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/2] dlm: Send lockspace name with uevents
Date: Tue, 13 Oct 2009 15:56:15 +0100 [thread overview]
Message-ID: <1255445776-3112-2-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1255445776-3112-1-git-send-email-swhiteho@redhat.com>
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>
---
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 d489fcc..8dde538 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)
return error;
}
+static int dlm_uevent(struct kset *kset, struct kobject *kobj,
+ struct kobj_uevent_env *env)
+{
+ struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj);
+
+ add_uevent_var(env, "LOCKSPACE=%s", ls->ls_name);
+ return 0;
+}
+
+static struct kset_uevent_ops dlm_uevent_ops = {
+ .uevent = dlm_uevent,
+};
int __init dlm_lockspace_init(void)
{
@@ -199,7 +211,7 @@ int __init dlm_lockspace_init(void)
INIT_LIST_HEAD(&lslist);
spin_lock_init(&lslist_lock);
- dlm_kset = kset_create_and_add("dlm", NULL, kernel_kobj);
+ dlm_kset = kset_create_and_add("dlm", &dlm_uevent_ops, kernel_kobj);
if (!dlm_kset) {
printk(KERN_WARNING "%s: can not create kset\n", __func__);
return -ENOMEM;
--
1.6.2.5
next prev parent reply other threads:[~2009-10-13 14:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 14:56 [Cluster-devel] A couple of DLM patches Steven Whitehouse
2009-10-13 14:56 ` Steven Whitehouse [this message]
2009-10-13 14:53 ` [Cluster-devel] Re: [PATCH 1/2] dlm: Send lockspace name with uevents David Teigland
2009-10-13 15:23 ` David Teigland
2009-10-13 15:43 ` Steven Whitehouse
2009-10-13 14:56 ` [Cluster-devel] [PATCH 2/2] dlm: Add down/up_write_non_owner to keep lockdep happy Steven Whitehouse
2009-11-12 13:27 ` [Cluster-devel] " Steven Whitehouse
[not found] ` <20091112142211.GA468@elte.hu>
2009-11-12 14:29 ` Steven Whitehouse
2009-11-12 17:14 ` David Teigland
2009-11-12 17:24 ` Steven Whitehouse
2009-11-12 18:34 ` David Teigland
2009-11-13 10:21 ` Steven Whitehouse
[not found] ` <1258044339.4039.685.camel@laptop>
2009-11-12 17:27 ` Steven Whitehouse
2009-11-12 18:21 ` David Teigland
-- strict thread matches above, loose matches on Subject: below --
2010-02-17 9:41 [Cluster-devel] [dlm] Two small sysfs patches Steven Whitehouse
2010-02-17 9:41 ` [Cluster-devel] [PATCH 1/2] dlm: Send lockspace name with uevents Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1255445776-3112-2-git-send-email-swhiteho@redhat.com \
--to=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).