[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1194047972-9850-12-git-send-email-gregkh@suse.de>
Date: Fri, 2 Nov 2007 16:58:50 -0700
From: Greg Kroah-Hartman <gregkh@...e.de>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Kay Sievers <kay.sievers@...y.org>,
Steven Whitehouse <swhiteho@...hat.com>
Subject: [PATCH 12/54] kset: convert gfs2 dlm to use kset_create
Dynamically create the kset instead of declaring it statically.
Cc: Kay Sievers <kay.sievers@...y.org>
Cc: Steven Whitehouse <swhiteho@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
fs/gfs2/locking/dlm/sysfs.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index 93e66b2..9c351db 100644
--- a/fs/gfs2/locking/dlm/sysfs.c
+++ b/fs/gfs2/locking/dlm/sysfs.c
@@ -189,7 +189,7 @@ static struct kobj_type gdlm_ktype = {
.sysfs_ops = &gdlm_attr_ops,
};
-static struct kset gdlm_kset;
+static struct kset *gdlm_kset;
int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj)
{
@@ -201,7 +201,7 @@ int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj)
return error;
}
- ls->kobj.kset = &gdlm_kset;
+ ls->kobj.kset = gdlm_kset;
ls->kobj.ktype = &gdlm_ktype;
ls->kobj.parent = fskobj;
@@ -221,17 +221,19 @@ int gdlm_sysfs_init(void)
{
int error;
- kobject_set_name(&gdlm_kset.kobj, "lock_dlm");
- gdlm_kset.kobj.kset = &kernel_subsys;
- error = kset_register(&gdlm_kset);
- if (error)
- printk("lock_dlm: cannot register kset %d\n", error);
-
- return error;
+ gdlm_kset = kset_create_and_register("lock_dlm", NULL,
+ NULL, &kernel_subsys);
+ if (IS_ERR(gdlm_kset)) {
+ error = PTR_ERR(gdlm_kset);
+ printk(KERN_WARNING "%s: can not create kset %d\n",
+ __FUNCTION__, error);
+ return error;
+ }
+ return 0;
}
void gdlm_sysfs_exit(void)
{
- kset_unregister(&gdlm_kset);
+ kset_unregister(gdlm_kset);
}
--
1.5.3.4
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists