From 823bccfc4002296ba88c3ad0f049e1abd8108d30 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 13 Apr 2007 13:15:19 -0700 Subject: remove "struct subsystem" as it is no longer needed We need to work on cleaning up the relationship between kobjects, ksets and ktypes. The removal of 'struct subsystem' is the first step of this, especially as it is not really needed at all. Thanks to Kay for fixing the bugs in this patch. Signed-off-by: Greg Kroah-Hartman --- fs/ecryptfs/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/ecryptfs/main.c') diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index fc4a3a224641..6acc8f4fc588 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -793,7 +793,7 @@ static int do_sysfs_registration(void) "Unable to register ecryptfs sysfs subsystem\n"); goto out; } - rc = sysfs_create_file(&ecryptfs_subsys.kset.kobj, + rc = sysfs_create_file(&ecryptfs_subsys.kobj, &sysfs_attr_version.attr); if (rc) { printk(KERN_ERR @@ -801,12 +801,12 @@ static int do_sysfs_registration(void) subsystem_unregister(&ecryptfs_subsys); goto out; } - rc = sysfs_create_file(&ecryptfs_subsys.kset.kobj, + rc = sysfs_create_file(&ecryptfs_subsys.kobj, &sysfs_attr_version_str.attr); if (rc) { printk(KERN_ERR "Unable to create ecryptfs version_str attribute\n"); - sysfs_remove_file(&ecryptfs_subsys.kset.kobj, + sysfs_remove_file(&ecryptfs_subsys.kobj, &sysfs_attr_version.attr); subsystem_unregister(&ecryptfs_subsys); goto out; @@ -841,7 +841,7 @@ static int __init ecryptfs_init(void) ecryptfs_free_kmem_caches(); goto out; } - kset_set_kset_s(&ecryptfs_subsys, fs_subsys); + kobj_set_kset_s(&ecryptfs_subsys, fs_subsys); sysfs_attr_version.attr.owner = THIS_MODULE; sysfs_attr_version_str.attr.owner = THIS_MODULE; rc = do_sysfs_registration(); @@ -862,9 +862,9 @@ out: static void __exit ecryptfs_exit(void) { - sysfs_remove_file(&ecryptfs_subsys.kset.kobj, + sysfs_remove_file(&ecryptfs_subsys.kobj, &sysfs_attr_version.attr); - sysfs_remove_file(&ecryptfs_subsys.kset.kobj, + sysfs_remove_file(&ecryptfs_subsys.kobj, &sysfs_attr_version_str.attr); subsystem_unregister(&ecryptfs_subsys); ecryptfs_release_messaging(ecryptfs_transport); -- cgit v1.2.1 From 50953fe9e00ebbeffa032a565ab2f08312d51a87 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sun, 6 May 2007 14:50:16 -0700 Subject: slab allocators: Remove SLAB_DEBUG_INITIAL flag I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by SLAB. I think its purpose was to have a callback after an object has been freed to verify that the state is the constructor state again? The callback is performed before each freeing of an object. I would think that it is much easier to check the object state manually before the free. That also places the check near the code object manipulation of the object. Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was compiled with SLAB debugging on. If there would be code in a constructor handling SLAB_DEBUG_INITIAL then it would have to be conditional on SLAB_DEBUG otherwise it would just be dead code. But there is no such code in the kernel. I think SLUB_DEBUG_INITIAL is too problematic to make real use of, difficult to understand and there are easier ways to accomplish the same effect (i.e. add debug code before kfree). There is a related flag SLAB_CTOR_VERIFY that is frequently checked to be clear in fs inode caches. Remove the pointless checks (they would even be pointless without removeal of SLAB_DEBUG_INITIAL) from the fs constructors. This is the last slab flag that SLUB did not support. Remove the check for unimplemented flags from SLUB. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/ecryptfs/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/ecryptfs/main.c') diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 6acc8f4fc588..8cbf3f69ebe5 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -583,8 +583,7 @@ inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags) { struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr; - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) == - SLAB_CTOR_CONSTRUCTOR) + if (flags & SLAB_CTOR_CONSTRUCTOR) inode_init_once(&ei->vfs_inode); } -- cgit v1.2.1