From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Teigland Date: Tue, 13 Oct 2009 09:53:37 -0500 Subject: [Cluster-devel] Re: [PATCH 1/2] dlm: Send lockspace name with uevents In-Reply-To: <1255445776-3112-2-git-send-email-swhiteho@redhat.com> References: <1255445776-3112-1-git-send-email-swhiteho@redhat.com> <1255445776-3112-2-git-send-email-swhiteho@redhat.com> Message-ID: <20091013145337.GA27036@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, Oct 13, 2009 at 03:56:15PM +0100, Steven Whitehouse wrote: > Although it is possible to get this information from the path, > its much easier to provide the lockspace as a seperate env > variable. I don't mind this, but it's more or less a style issue. I'm going to try to keep upstream and rhel as close as possible for a while to minimize the backporting work in the early stages when it's usually heaviest. That means putting off things like this until later. > Signed-off-by: Steven Whitehouse > --- > 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