Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27c3a314d55b810f3b51902d1d815c714a7afbd2
Commit:     27c3a314d55b810f3b51902d1d815c714a7afbd2
Parent:     aade4041aa60a3ed335391ba308458e26f2dbc0a
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 1 09:29:06 2007 -0600
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jan 24 20:40:15 2008 -0800

    kset: convert slub to use kset_create
    
    Dynamically create the kset instead of declaring it statically.
    
    Cc: Kay Sievers <[EMAIL PROTECTED]>
    Cc: Christoph Lameter <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 mm/slub.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 40bdf41..886131c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3962,7 +3962,7 @@ static struct kset_uevent_ops slab_uevent_ops = {
        .filter = uevent_filter,
 };
 
-static decl_subsys(slab, &slab_uevent_ops);
+static struct kset *slab_kset;
 
 #define ID_STR_LENGTH 64
 
@@ -4015,7 +4015,7 @@ static int sysfs_slab_add(struct kmem_cache *s)
                 * This is typically the case for debug situations. In that
                 * case we can catch duplicate names easily.
                 */
-               sysfs_remove_link(&slab_subsys.kobj, s->name);
+               sysfs_remove_link(&slab_kset->kobj, s->name);
                name = s->name;
        } else {
                /*
@@ -4026,7 +4026,7 @@ static int sysfs_slab_add(struct kmem_cache *s)
        }
 
        kobject_set_name(&s->kobj, name);
-       s->kobj.kset = &slab_subsys;
+       s->kobj.kset = slab_kset;
        s->kobj.ktype = &slab_ktype;
        kobject_init(&s->kobj);
        err = kobject_add(&s->kobj);
@@ -4071,9 +4071,8 @@ static int sysfs_slab_alias(struct kmem_cache *s, const 
char *name)
                /*
                 * If we have a leftover link then remove it.
                 */
-               sysfs_remove_link(&slab_subsys.kobj, name);
-               return sysfs_create_link(&slab_subsys.kobj,
-                                               &s->kobj, name);
+               sysfs_remove_link(&slab_kset->kobj, name);
+               return sysfs_create_link(&slab_kset->kobj, &s->kobj, name);
        }
 
        al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL);
@@ -4092,8 +4091,8 @@ static int __init slab_sysfs_init(void)
        struct kmem_cache *s;
        int err;
 
-       err = subsystem_register(&slab_subsys);
-       if (err) {
+       slab_kset = kset_create_and_add("slab", &slab_uevent_ops, NULL);
+       if (!slab_kset) {
                printk(KERN_ERR "Cannot register slab subsystem.\n");
                return -ENOSYS;
        }
-
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