Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762736AbXKCAHx (ORCPT ); Fri, 2 Nov 2007 20:07:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756521AbXKCABi (ORCPT ); Fri, 2 Nov 2007 20:01:38 -0400 Received: from ns2.suse.de ([195.135.220.15]:34850 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761722AbXKCABh (ORCPT ); Fri, 2 Nov 2007 20:01:37 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Kay Sievers , Christoph Lameter Subject: [PATCH 23/54] kset: convert slub to use kset_create Date: Fri, 2 Nov 2007 16:59:01 -0700 Message-Id: <1194047972-9850-23-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.5.3.4 In-Reply-To: <20071102235758.GA9803@kroah.com> References: <20071102235758.GA9803@kroah.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2431 Lines: 83 Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Christoph Lameter Signed-off-by: Greg Kroah-Hartman --- mm/slub.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index b821fdb..9957683 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -21,6 +21,7 @@ #include #include #include +#include /* * Lock order: @@ -3978,7 +3979,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 @@ -4031,7 +4032,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 { /* @@ -4042,7 +4043,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); @@ -4087,9 +4088,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); @@ -4108,10 +4108,11 @@ 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_register("slab", &slab_uevent_ops, + NULL, NULL); + if (IS_ERR(slab_kset)) { printk(KERN_ERR "Cannot register slab subsystem.\n"); - return -ENOSYS; + return PTR_ERR(slab_kset); } slab_state = SYSFS; -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/