aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:34:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:35:13 -0500
commitdf8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e (patch)
treebc3799a43e8b94fa84b32e37b1c124d5e4868f50 /mm
parent556a169dab38b5100df6f4a45b655dddd3db94c1 (diff)
parent4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
This can be broken down into these major areas: - Documentation updates (language translations and fixes, as well as kobject and kset documenatation updates.) - major kset/kobject/ktype rework and fixes. This cleans up the kset and kobject and ktype relationship and architecture, making sense of things now, and good documenation and samples are provided for others to use. Also the attributes for kobjects are much easier to handle now. This cleaned up a LOT of code all through the kernel, making kobjects easier to use if you want to. - struct bus_type has been reworked to now handle the lifetime rules properly, as the kobject is properly dynamic. - struct driver has also been reworked, and now the lifetime issues are resolved. - the block subsystem has been converted to use struct device now, and not "raw" kobjects. This patch has been in the -mm tree for over a year now, and finally all the issues are worked out with it. Older distros now properly work with new kernels, and no userspace updates are needed at all. - nozomi driver is added. This has also been in -mm for a long time, and many people have asked for it to go in. It is now in good enough shape to do so. - lots of class_device conversions to use struct device instead. The tree is almost all cleaned up now, only SCSI and IB is the remaining code to fix up... * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits) Driver core: coding style fixes Kobject: fix coding style issues in kobject c files Kobject: fix coding style issues in kobject.h Driver core: fix coding style issues in device.h spi: use class iteration api scsi: use class iteration api rtc: use class iteration api power supply : use class iteration api ieee1394: use class iteration api Driver Core: add class iteration api Driver core: Cleanup get_device_parent() in device_add() and device_move() UIO: constify function pointer tables Driver Core: constify the name passed to platform_device_register_simple driver core: fix build with SYSFS=n sysfs: make SYSFS_DEPRECATED depend on SYSFS Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init kobject: add sample code for how to use ksets/ktypes/kobjects kobject: add sample code for how to use kobjects in a simple manner. kobject: update the kobject/kset documentation kobject: remove old, outdated documentation. ...
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 474945ecd89d..5cc4b7dddb50 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_ktype, &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 /*
@@ -4025,12 +4025,12 @@ static int sysfs_slab_add(struct kmem_cache *s)
4025 name = create_unique_id(s); 4025 name = create_unique_id(s);
4026 } 4026 }
4027 4027
4028 kobj_set_kset_s(s, slab_subsys); 4028 s->kobj.kset = slab_kset;
4029 kobject_set_name(&s->kobj, name); 4029 err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, name);
4030 kobject_init(&s->kobj); 4030 if (err) {
4031 err = kobject_add(&s->kobj); 4031 kobject_put(&s->kobj);
4032 if (err)
4033 return err; 4032 return err;
4033 }
4034 4034
4035 err = sysfs_create_group(&s->kobj, &slab_attr_group); 4035 err = sysfs_create_group(&s->kobj, &slab_attr_group);
4036 if (err) 4036 if (err)
@@ -4070,9 +4070,8 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
4070 /* 4070 /*
4071 * If we have a leftover link then remove it. 4071 * If we have a leftover link then remove it.
4072 */ 4072 */
4073 sysfs_remove_link(&slab_subsys.kobj, name); 4073 sysfs_remove_link(&slab_kset->kobj, name);
4074 return sysfs_create_link(&slab_subsys.kobj, 4074 return sysfs_create_link(&slab_kset->kobj, &s->kobj, name);
4075 &s->kobj, name);
4076 } 4075 }
4077 4076
4078 al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL); 4077 al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL);
@@ -4091,8 +4090,8 @@ static int __init slab_sysfs_init(void)
4091 struct kmem_cache *s; 4090 struct kmem_cache *s;
4092 int err; 4091 int err;
4093 4092
4094 err = subsystem_register(&slab_subsys); 4093 slab_kset = kset_create_and_add("slab", &slab_uevent_ops, kernel_kobj);
4095 if (err) { 4094 if (!slab_kset) {
4096 printk(KERN_ERR "Cannot register slab subsystem.\n"); 4095 printk(KERN_ERR "Cannot register slab subsystem.\n");
4097 return -ENOSYS; 4096 return -ENOSYS;
4098 } 4097 }