From 8765965b24f22a5519f1429406fd5d67f6c673d1 Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Thu, 2 Nov 2006 14:41:23 +0000 Subject: [PATCH] --- yaml --- r: 40760 b: refs/heads/master c: ba542e3b92f9ea7c482ae56b68b9122eebc53a39 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/dlm/lockspace.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 21a699ff9a92..dfadaa293108 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 26d83dedf61d26d85f10bc34b92f4de7660fd746 +refs/heads/master: ba542e3b92f9ea7c482ae56b68b9122eebc53a39 diff --git a/trunk/fs/dlm/lockspace.c b/trunk/fs/dlm/lockspace.c index 109333c8ecb9..499ee1156365 100644 --- a/trunk/fs/dlm/lockspace.c +++ b/trunk/fs/dlm/lockspace.c @@ -143,6 +143,12 @@ static ssize_t dlm_attr_store(struct kobject *kobj, struct attribute *attr, return a->store ? a->store(ls, buf, len) : len; } +static void lockspace_kobj_release(struct kobject *k) +{ + struct dlm_ls *ls = container_of(k, struct dlm_ls, ls_kobj); + kfree(ls); +} + static struct sysfs_ops dlm_attr_ops = { .show = dlm_attr_show, .store = dlm_attr_store, @@ -151,6 +157,7 @@ static struct sysfs_ops dlm_attr_ops = { static struct kobj_type dlm_ktype = { .default_attrs = dlm_attrs, .sysfs_ops = &dlm_attr_ops, + .release = lockspace_kobj_release, }; static struct kset dlm_kset = { @@ -678,7 +685,7 @@ static int release_lockspace(struct dlm_ls *ls, int force) dlm_clear_members_gone(ls); kfree(ls->ls_node_array); kobject_unregister(&ls->ls_kobj); - kfree(ls); + /* The ls structure will be freed when the kobject is done with */ mutex_lock(&ls_lock); ls_count--;