aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-01 11:29:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:15 -0500
commit27c3a314d55b810f3b51902d1d815c714a7afbd2 (patch)
tree9f3efcc6d94661eda3ed10aa96fb011c7fe164d8 /mm/slub.c
parentaade4041aa60a3ed335391ba308458e26f2dbc0a (diff)
kset: convert slub to use kset_create
Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 40bdf41035e5..886131c5b5ca 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3962,7 +3962,7 @@ static struct kset_uevent_ops slab_uevent_ops = {
3962 .filter = uevent_filter, 3962 .filter = uevent_filter,
3963}; 3963};
3964 3964
3965static decl_subsys(slab, &slab_uevent_ops); 3965static struct kset *slab_kset;
3966 3966
3967#define ID_STR_LENGTH 64 3967#define ID_STR_LENGTH 64
3968 3968
@@ -4015,7 +4015,7 @@ static int sysfs_slab_add(struct kmem_cache *s)
4015 * This is typically the case for debug situations. In that 4015 * This is typically the case for debug situations. In that
4016 * case we can catch duplicate names easily. 4016 * case we can catch duplicate names easily.
4017 */ 4017 */
4018 sysfs_remove_link(&slab_subsys.kobj, s->name); 4018 sysfs_remove_link(&slab_kset->kobj, s->name);
4019 name = s->name; 4019 name = s->name;
4020 } else { 4020 } else {
4021 /* 4021 /*
@@ -4026,7 +4026,7 @@ static int sysfs_slab_add(struct kmem_cache *s)
4026 } 4026 }
4027 4027
4028 kobject_set_name(&s->kobj, name); 4028 kobject_set_name(&s->kobj, name);
4029 s->kobj.kset = &slab_subsys; 4029 s->kobj.kset = slab_kset;
4030 s->kobj.ktype = &slab_ktype; 4030 s->kobj.ktype = &slab_ktype;
4031 kobject_init(&s->kobj); 4031 kobject_init(&s->kobj);
4032 err = kobject_add(&s->kobj); 4032 err = kobject_add(&s->kobj);
@@ -4071,9 +4071,8 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
4071 /* 4071 /*
4072 * If we have a leftover link then remove it. 4072 * If we have a leftover link then remove it.
4073 */ 4073 */
4074 sysfs_remove_link(&slab_subsys.kobj, name); 4074 sysfs_remove_link(&slab_kset->kobj, name);
4075 return sysfs_create_link(&slab_subsys.kobj, 4075 return sysfs_create_link(&slab_kset->kobj, &s->kobj, name);
4076 &s->kobj, name);
4077 } 4076 }
4078 4077
4079 al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL); 4078 al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL);
@@ -4092,8 +4091,8 @@ static int __init slab_sysfs_init(void)
4092 struct kmem_cache *s; 4091 struct kmem_cache *s;
4093 int err; 4092 int err;
4094 4093
4095 err = subsystem_register(&slab_subsys); 4094 slab_kset = kset_create_and_add("slab", &slab_uevent_ops, NULL);
4096 if (err) { 4095 if (!slab_kset) {
4097 printk(KERN_ERR "Cannot register slab subsystem.\n"); 4096 printk(KERN_ERR "Cannot register slab subsystem.\n");
4098 return -ENOSYS; 4097 return -ENOSYS;
4099 } 4098 }