Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d405936b322220dc5cca9d2b58ef1911ae8efec9
Commit:     d405936b322220dc5cca9d2b58ef1911ae8efec9
Parent:     136a27507fd09006973f11b17ca971d4c176a06a
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 29 20:13:17 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jan 24 20:40:14 2008 -0800

    kset: convert dlm to use kset_create
    
    Dynamically create the kset instead of declaring it statically.
    
    Cc: Kay Sievers <[EMAIL PROTECTED]>
    Cc: Steven Whitehouse <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/dlm/lockspace.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 18e4a17..83a9c4d 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -166,7 +166,7 @@ static struct kobj_type dlm_ktype = {
        .release       = lockspace_kobj_release,
 };
 
-static struct kset dlm_kset;
+static struct kset *dlm_kset;
 
 static int kobject_setup(struct dlm_ls *ls)
 {
@@ -180,7 +180,7 @@ static int kobject_setup(struct dlm_ls *ls)
        if (error)
                return error;
 
-       ls->ls_kobj.kset = &dlm_kset;
+       ls->ls_kobj.kset = dlm_kset;
        ls->ls_kobj.ktype = &dlm_ktype;
        return 0;
 }
@@ -218,24 +218,22 @@ static int do_uevent(struct dlm_ls *ls, int in)
 
 int dlm_lockspace_init(void)
 {
-       int error;
-
        ls_count = 0;
        mutex_init(&ls_lock);
        INIT_LIST_HEAD(&lslist);
        spin_lock_init(&lslist_lock);
 
-       kobject_set_name(&dlm_kset.kobj, "dlm");
-       dlm_kset.kobj.kset = &kernel_subsys;
-       error = kset_register(&dlm_kset);
-       if (error)
-               printk("dlm_lockspace_init: cannot register kset %d\n", error);
-       return error;
+       dlm_kset = kset_create_and_add("dlm", NULL, &kernel_subsys.kobj);
+       if (!dlm_kset) {
+               printk(KERN_WARNING "%s: can not create kset\n", __FUNCTION__);
+               return -ENOMEM;
+       }
+       return 0;
 }
 
 void dlm_lockspace_exit(void)
 {
-       kset_unregister(&dlm_kset);
+       kset_unregister(dlm_kset);
 }
 
 static int dlm_scand(void *data)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to