aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/lockspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r--fs/dlm/lockspace.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 109333c8ecb9..499ee1156365 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -143,6 +143,12 @@ static ssize_t dlm_attr_store(struct kobject *kobj, struct attribute *attr,
143 return a->store ? a->store(ls, buf, len) : len; 143 return a->store ? a->store(ls, buf, len) : len;
144} 144}
145 145
146static void lockspace_kobj_release(struct kobject *k)
147{
148 struct dlm_ls *ls = container_of(k, struct dlm_ls, ls_kobj);
149 kfree(ls);
150}
151
146static struct sysfs_ops dlm_attr_ops = { 152static struct sysfs_ops dlm_attr_ops = {
147 .show = dlm_attr_show, 153 .show = dlm_attr_show,
148 .store = dlm_attr_store, 154 .store = dlm_attr_store,
@@ -151,6 +157,7 @@ static struct sysfs_ops dlm_attr_ops = {
151static struct kobj_type dlm_ktype = { 157static struct kobj_type dlm_ktype = {
152 .default_attrs = dlm_attrs, 158 .default_attrs = dlm_attrs,
153 .sysfs_ops = &dlm_attr_ops, 159 .sysfs_ops = &dlm_attr_ops,
160 .release = lockspace_kobj_release,
154}; 161};
155 162
156static struct kset dlm_kset = { 163static struct kset dlm_kset = {
@@ -678,7 +685,7 @@ static int release_lockspace(struct dlm_ls *ls, int force)
678 dlm_clear_members_gone(ls); 685 dlm_clear_members_gone(ls);
679 kfree(ls->ls_node_array); 686 kfree(ls->ls_node_array);
680 kobject_unregister(&ls->ls_kobj); 687 kobject_unregister(&ls->ls_kobj);
681 kfree(ls); 688 /* The ls structure will be freed when the kobject is done with */
682 689
683 mutex_lock(&ls_lock); 690 mutex_lock(&ls_lock);
684 ls_count--; 691 ls_count--;