]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Remove SLAB_CTOR_CONSTRUCTOR
authorChristoph Lameter <clameter@sgi.com>
Thu, 17 May 2007 05:10:57 +0000 (22:10 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 17 May 2007 12:23:04 +0000 (05:23 -0700)
SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Anton Altaparmakov <aia21@cantab.net>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@ucw.cz>
Cc: David Chinner <dgc@sgi.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
56 files changed:
arch/powerpc/platforms/cell/spufs/inode.c
drivers/mtd/ubi/eba.c
fs/adfs/super.c
fs/affs/super.c
fs/afs/super.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/block_dev.c
fs/buffer.c
fs/cifs/cifsfs.c
fs/coda/inode.c
fs/ecryptfs/main.c
fs/efs/super.c
fs/ext2/super.c
fs/ext3/super.c
fs/ext4/super.c
fs/fat/cache.c
fs/fat/inode.c
fs/fuse/inode.c
fs/gfs2/main.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hpfs/super.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/isofs/inode.c
fs/jffs2/super.c
fs/jfs/jfs_metapage.c
fs/jfs/super.c
fs/locks.c
fs/minix/inode.c
fs/ncpfs/inode.c
fs/nfs/inode.c
fs/ntfs/super.c
fs/ocfs2/dlm/dlmfs.c
fs/ocfs2/super.c
fs/openpromfs/inode.c
fs/proc/inode.c
fs/qnx4/inode.c
fs/reiserfs/super.c
fs/romfs/inode.c
fs/smbfs/inode.c
fs/sysv/inode.c
fs/udf/super.c
fs/ufs/super.c
fs/xfs/linux-2.6/xfs_super.c
include/linux/slab.h
ipc/mqueue.c
kernel/fork.c
mm/rmap.c
mm/shmem.c
mm/slab.c
mm/slob.c
mm/slub.c
net/socket.c
net/sunrpc/rpc_pipe.c

index a93f328a73178fa6e21a194d74667c2353289d19..7150730e2ff11b9896039bd46a05ef83c8d26931 100644 (file)
@@ -71,9 +71,7 @@ spufs_init_once(void *p, struct kmem_cache * cachep, unsigned long flags)
 {
        struct spufs_inode_info *ei = p;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               inode_init_once(&ei->vfs_inode);
-       }
+       inode_init_once(&ei->vfs_inode);
 }
 
 static struct inode *
index 3dba5733ed1febbd9079ed9c0628077b1ed51f86..74002945b71b6d1123f21c0f2766eca37d2f53e8 100644 (file)
@@ -940,9 +940,6 @@ static void ltree_entry_ctor(void *obj, struct kmem_cache *cache,
 {
        struct ltree_entry *le = obj;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               return;
-
        le->users = 0;
        init_rwsem(&le->mutex);
 }
index 30c296508497d0d127f9d1742d520aceb142dee9..de2ed5ca335192f44e813b52e2b840b0c94c2a1f 100644 (file)
@@ -232,8 +232,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index beff7d21e6e2f769064e87e92359a133790fedf0..b800d451cd6020f49f0963b9832d15eea221eb50 100644 (file)
@@ -87,11 +87,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct affs_inode_info *ei = (struct affs_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               init_MUTEX(&ei->i_link_lock);
-               init_MUTEX(&ei->i_ext_lock);
-               inode_init_once(&ei->vfs_inode);
-       }
+       init_MUTEX(&ei->i_link_lock);
+       init_MUTEX(&ei->i_ext_lock);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int init_inodecache(void)
index 370cecc910db4b302144495a13311d3a2deb5401..8d47ad88a0932b2d4fdea8bbcbfb07de9e7cb4f6 100644 (file)
@@ -451,17 +451,15 @@ static void afs_i_init_once(void *_vnode, struct kmem_cache *cachep,
 {
        struct afs_vnode *vnode = _vnode;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               memset(vnode, 0, sizeof(*vnode));
-               inode_init_once(&vnode->vfs_inode);
-               init_waitqueue_head(&vnode->update_waitq);
-               mutex_init(&vnode->permits_lock);
-               mutex_init(&vnode->validate_lock);
-               spin_lock_init(&vnode->writeback_lock);
-               spin_lock_init(&vnode->lock);
-               INIT_LIST_HEAD(&vnode->writebacks);
-               INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
-       }
+       memset(vnode, 0, sizeof(*vnode));
+       inode_init_once(&vnode->vfs_inode);
+       init_waitqueue_head(&vnode->update_waitq);
+       mutex_init(&vnode->permits_lock);
+       mutex_init(&vnode->validate_lock);
+       spin_lock_init(&vnode->writeback_lock);
+       spin_lock_init(&vnode->lock);
+       INIT_LIST_HEAD(&vnode->writebacks);
+       INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
 }
 
 /*
index fe96108a788d6d9b84fb56114cfde3e4ab42db50..a5c5171c2828997baa249bcad6d360c657969a79 100644 (file)
@@ -292,10 +292,8 @@ befs_destroy_inode(struct inode *inode)
 static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
 {
         struct befs_inode_info *bi = (struct befs_inode_info *) foo;
-       
-               if (flags & SLAB_CTOR_CONSTRUCTOR) {
-                       inode_init_once(&bi->vfs_inode);
-               }
+
+       inode_init_once(&bi->vfs_inode);
 }
 
 static void
index edc08d89aabc5a2979c2b2a9c0ffb49b20f3ae7b..58c7bd9f5301539294531c6557a097dcd780422d 100644 (file)
@@ -248,8 +248,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct bfs_inode_info *bi = foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&bi->vfs_inode);
+       inode_init_once(&bi->vfs_inode);
 }
  
 static int init_inodecache(void)
index 742899240872ffb59e7329f6dabef624798c2fbb..ea1480a16f517d85d12de02bfde8afa53a43037c 100644 (file)
@@ -458,17 +458,15 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
        struct bdev_inode *ei = (struct bdev_inode *) foo;
        struct block_device *bdev = &ei->bdev;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               memset(bdev, 0, sizeof(*bdev));
-               mutex_init(&bdev->bd_mutex);
-               sema_init(&bdev->bd_mount_sem, 1);
-               INIT_LIST_HEAD(&bdev->bd_inodes);
-               INIT_LIST_HEAD(&bdev->bd_list);
+       memset(bdev, 0, sizeof(*bdev));
+       mutex_init(&bdev->bd_mutex);
+       sema_init(&bdev->bd_mount_sem, 1);
+       INIT_LIST_HEAD(&bdev->bd_inodes);
+       INIT_LIST_HEAD(&bdev->bd_list);
 #ifdef CONFIG_SYSFS
-               INIT_LIST_HEAD(&bdev->bd_holder_list);
+       INIT_LIST_HEAD(&bdev->bd_holder_list);
 #endif
-               inode_init_once(&ei->vfs_inode);
-       }
+       inode_init_once(&ei->vfs_inode);
 }
 
 static inline void __bd_forget(struct inode *inode)
index aecd057cd0e0607631201d93be38bda0b9e44001..3deeb886f6e6f76ffe18a1893eed724f5e588639 100644 (file)
@@ -2898,8 +2898,9 @@ static void recalc_bh_state(void)
        
 struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
 {
-       struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags);
+       struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
        if (ret) {
+               INIT_LIST_HEAD(&ret->b_assoc_buffers);
                get_cpu_var(bh_accounting).nr++;
                recalc_bh_state();
                put_cpu_var(bh_accounting);
@@ -2918,17 +2919,6 @@ void free_buffer_head(struct buffer_head *bh)
 }
 EXPORT_SYMBOL(free_buffer_head);
 
-static void
-init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
-{
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               struct buffer_head * bh = (struct buffer_head *)data;
-
-               memset(bh, 0, sizeof(*bh));
-               INIT_LIST_HEAD(&bh->b_assoc_buffers);
-       }
-}
-
 static void buffer_exit_cpu(int cpu)
 {
        int i;
@@ -2955,12 +2945,8 @@ void __init buffer_init(void)
 {
        int nrpages;
 
-       bh_cachep = kmem_cache_create("buffer_head",
-                                       sizeof(struct buffer_head), 0,
-                                       (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
-                                       SLAB_MEM_SPREAD),
-                                       init_buffer_head,
-                                       NULL);
+       bh_cachep = KMEM_CACHE(buffer_head,
+                       SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
 
        /*
         * Limit the bh occupancy to 10% of ZONE_NORMAL
index 8568e100953cd52f2cee789fd986356e2106d5a4..d38c69b591cfe0907d3d9e08bdb0da0380321709 100644 (file)
@@ -701,10 +701,8 @@ cifs_init_once(void *inode, struct kmem_cache * cachep, unsigned long flags)
 {
        struct cifsInodeInfo *cifsi = inode;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               inode_init_once(&cifsi->vfs_inode);
-               INIT_LIST_HEAD(&cifsi->lockList);
-       }
+       inode_init_once(&cifsi->vfs_inode);
+       INIT_LIST_HEAD(&cifsi->lockList);
 }
 
 static int
index 0aaff3651d146a32ade9cd540abbc9e69a263d68..dbff1bd4fb96b13c3b28b39876220c6cac2363ef 100644 (file)
@@ -62,8 +62,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct coda_inode_info *ei = (struct coda_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 int coda_init_inodecache(void)
index 8cbf3f69ebe5a3a1db05cf785553b579ce101205..606128f5c927d3697c04f4f84ee64718e9cfd71b 100644 (file)
@@ -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_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static struct ecryptfs_cache_info {
index ba7a8b9da0c1663e926a78722c4d5d4e445e58e7..e0a6839e68ae0f53f762a5f4aed8466b6d1d98ff 100644 (file)
@@ -72,8 +72,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct efs_inode_info *ei = (struct efs_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 685a1c287177f6f16f8e3ebc8f1ca40b630c709b..16337bff0272e1ca9dad792eba727f4e11778cb9 100644 (file)
@@ -160,13 +160,11 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               rwlock_init(&ei->i_meta_lock);
+       rwlock_init(&ei->i_meta_lock);
 #ifdef CONFIG_EXT2_FS_XATTR
-               init_rwsem(&ei->xattr_sem);
+       init_rwsem(&ei->xattr_sem);
 #endif
-               inode_init_once(&ei->vfs_inode);
-       }
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 54d3c90412598f3c13bb0c4c76dc8ad5545819ee..6e3062913a92f52544a35169fb1ab6e9a44e7831 100644 (file)
@@ -466,14 +466,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               INIT_LIST_HEAD(&ei->i_orphan);
+       INIT_LIST_HEAD(&ei->i_orphan);
 #ifdef CONFIG_EXT3_FS_XATTR
-               init_rwsem(&ei->xattr_sem);
+       init_rwsem(&ei->xattr_sem);
 #endif
-               mutex_init(&ei->truncate_mutex);
-               inode_init_once(&ei->vfs_inode);
-       }
+       mutex_init(&ei->truncate_mutex);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int init_inodecache(void)
index 71912693235487e40901625d7c0f3def0a729e15..cb9afdd0e26e5f8f458329aaab3e04be6daf9a5c 100644 (file)
@@ -517,14 +517,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               INIT_LIST_HEAD(&ei->i_orphan);
+       INIT_LIST_HEAD(&ei->i_orphan);
 #ifdef CONFIG_EXT4DEV_FS_XATTR
-               init_rwsem(&ei->xattr_sem);
+       init_rwsem(&ei->xattr_sem);
 #endif
-               mutex_init(&ei->truncate_mutex);
-               inode_init_once(&ei->vfs_inode);
-       }
+       mutex_init(&ei->truncate_mutex);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int init_inodecache(void)
index 1959143c1d27ad9876abff95f5c6668566217513..3c9c8a15ec73fec582d6959b3f1d41e1c4ab5edc 100644 (file)
@@ -40,8 +40,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
        struct fat_cache *cache = (struct fat_cache *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               INIT_LIST_HEAD(&cache->cache_list);
+       INIT_LIST_HEAD(&cache->cache_list);
 }
 
 int __init fat_cache_init(void)
index 2c55e8dce7932cfaa2b8b7b026633267a6c82b0f..479722d8966734cbd9bb64f82dc89940a075eedd 100644 (file)
@@ -500,14 +500,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               spin_lock_init(&ei->cache_lru_lock);
-               ei->nr_caches = 0;
-               ei->cache_valid_id = FAT_CACHE_VALID + 1;
-               INIT_LIST_HEAD(&ei->cache_lru);
-               INIT_HLIST_NODE(&ei->i_fat_hash);
-               inode_init_once(&ei->vfs_inode);
-       }
+       spin_lock_init(&ei->cache_lru_lock);
+       ei->nr_caches = 0;
+       ei->cache_valid_id = FAT_CACHE_VALID + 1;
+       INIT_LIST_HEAD(&ei->cache_lru);
+       INIT_HLIST_NODE(&ei->i_fat_hash);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int __init fat_init_inodecache(void)
index 1397018ff47665e28bead1fb5a75592703c762c9..c3a2ad0da43c5517775e8c9ddaceede082eb16af 100644 (file)
@@ -687,8 +687,7 @@ static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
 {
        struct inode * inode = foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(inode);
+       inode_init_once(inode);
 }
 
 static int __init fuse_fs_init(void)
index e460487c0557426cdaa5cb6e0abcfd127832444b..787a0edef100504727184274622d21c48385af93 100644 (file)
 static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
        struct gfs2_inode *ip = foo;
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               inode_init_once(&ip->i_inode);
-               spin_lock_init(&ip->i_spin);
-               init_rwsem(&ip->i_rw_mutex);
-               memset(ip->i_cache, 0, sizeof(ip->i_cache));
-       }
+
+       inode_init_once(&ip->i_inode);
+       spin_lock_init(&ip->i_spin);
+       init_rwsem(&ip->i_rw_mutex);
+       memset(ip->i_cache, 0, sizeof(ip->i_cache));
 }
 
 static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
        struct gfs2_glock *gl = foo;
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               INIT_HLIST_NODE(&gl->gl_list);
-               spin_lock_init(&gl->gl_spin);
-               INIT_LIST_HEAD(&gl->gl_holders);
-               INIT_LIST_HEAD(&gl->gl_waiters1);
-               INIT_LIST_HEAD(&gl->gl_waiters3);
-               gl->gl_lvb = NULL;
-               atomic_set(&gl->gl_lvb_count, 0);
-               INIT_LIST_HEAD(&gl->gl_reclaim);
-               INIT_LIST_HEAD(&gl->gl_ail_list);
-               atomic_set(&gl->gl_ail_count, 0);
-       }
+
+       INIT_HLIST_NODE(&gl->gl_list);
+       spin_lock_init(&gl->gl_spin);
+       INIT_LIST_HEAD(&gl->gl_holders);
+       INIT_LIST_HEAD(&gl->gl_waiters1);
+       INIT_LIST_HEAD(&gl->gl_waiters3);
+       gl->gl_lvb = NULL;
+       atomic_set(&gl->gl_lvb_count, 0);
+       INIT_LIST_HEAD(&gl->gl_reclaim);
+       INIT_LIST_HEAD(&gl->gl_ail_list);
+       atomic_set(&gl->gl_ail_count, 0);
 }
 
 /**
index 4f1888f16cf0b061a3b802c8b7175f26ef66a9da..92cf8751e428728cfb9902580be7ce2a6357c54d 100644 (file)
@@ -434,8 +434,7 @@ static void hfs_init_once(void *p, struct kmem_cache *cachep, unsigned long flag
 {
        struct hfs_inode_info *i = p;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&i->vfs_inode);
+       inode_init_once(&i->vfs_inode);
 }
 
 static int __init init_hfs_fs(void)
index 37afbec8a76127e011862d2a01c65e34e70b789a..ebd1b380cbbc9d7dc839ca7337efb5073da8cd86 100644 (file)
@@ -470,8 +470,7 @@ static void hfsplus_init_once(void *p, struct kmem_cache *cachep, unsigned long
 {
        struct hfsplus_inode_info *i = p;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&i->vfs_inode);
+       inode_init_once(&i->vfs_inode);
 }
 
 static int __init init_hfsplus_fs(void)
index 1b95f39fbc37a973bb068b988a16de4281f71f36..fca1165d7192198bdb0f4ba29ca8dae833981c13 100644 (file)
@@ -176,11 +176,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               mutex_init(&ei->i_mutex);
-               mutex_init(&ei->i_parent_mutex);
-               inode_init_once(&ei->vfs_inode);
-       }
+       mutex_init(&ei->i_mutex);
+       mutex_init(&ei->i_parent_mutex);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 98959b87cdf8f1f674c668673b10bf110a7bf653..aa083dd34e924199816587d57861d48dfa84dbfe 100644 (file)
@@ -556,8 +556,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
        struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
 
 const struct file_operations hugetlbfs_file_operations = {
index df2ef15d03d256157c70b4a8b8be0b751d1dfab1..9a012cc5b6cd6e060977a6b13565c8f11d98dfca 100644 (file)
@@ -213,8 +213,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct inode * inode = (struct inode *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(inode);
+       inode_init_once(inode);
 }
 
 /*
index e99f7ff4ecb4470876a2713a551c00de765f284c..5c3eecf7542ee0cebc0e0c2e8d68c988214df87d 100644 (file)
@@ -77,8 +77,7 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
 {
        struct iso_inode_info *ei = foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 45368f8bbe72d52e7dee1f300e8b13bd60139eb1..6488af43bc9b757e5de859184aacd987404d866f 100644 (file)
@@ -47,10 +47,8 @@ static void jffs2_i_init_once(void * foo, struct kmem_cache * cachep, unsigned l
 {
        struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               init_MUTEX(&ei->sem);
-               inode_init_once(&ei->vfs_inode);
-       }
+       init_MUTEX(&ei->sem);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int jffs2_sync_fs(struct super_block *sb, int wait)
index 6b3acb0b5781180a91970ee1c550b7314037a888..43d4f69afbeca923878a45d77fa68d4eb53a55f9 100644 (file)
@@ -184,16 +184,14 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
        struct metapage *mp = (struct metapage *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               mp->lid = 0;
-               mp->lsn = 0;
-               mp->flag = 0;
-               mp->data = NULL;
-               mp->clsn = 0;
-               mp->log = NULL;
-               set_bit(META_free, &mp->flag);
-               init_waitqueue_head(&mp->wait);
-       }
+       mp->lid = 0;
+       mp->lsn = 0;
+       mp->flag = 0;
+       mp->data = NULL;
+       mp->clsn = 0;
+       mp->log = NULL;
+       set_bit(META_free, &mp->flag);
+       init_waitqueue_head(&mp->wait);
 }
 
 static inline struct metapage *alloc_metapage(gfp_t gfp_mask)
index ea9dc3e65dcf762969a734a0cb3b18f924a1be2e..20e4ac1c79a3ca2943be23d903f5f0ad8236fbbe 100644 (file)
@@ -752,20 +752,18 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
 {
        struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
-               INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
-               init_rwsem(&jfs_ip->rdwrlock);
-               mutex_init(&jfs_ip->commit_mutex);
-               init_rwsem(&jfs_ip->xattr_sem);
-               spin_lock_init(&jfs_ip->ag_lock);
-               jfs_ip->active_ag = -1;
+       memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
+       INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
+       init_rwsem(&jfs_ip->rdwrlock);
+       mutex_init(&jfs_ip->commit_mutex);
+       init_rwsem(&jfs_ip->xattr_sem);
+       spin_lock_init(&jfs_ip->ag_lock);
+       jfs_ip->active_ag = -1;
 #ifdef CONFIG_JFS_POSIX_ACL
-               jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
-               jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED;
+       jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
+       jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED;
 #endif
-               inode_init_once(&jfs_ip->vfs_inode);
-       }
+       inode_init_once(&jfs_ip->vfs_inode);
 }
 
 static int __init init_jfs_fs(void)
index 8ec16ab5ef7449222744b3c2829e37fbf8f6d88b..431a8b871fcef03ea098f8d8ac8f8602a2d33f66 100644 (file)
@@ -203,9 +203,6 @@ static void init_once(void *foo, struct kmem_cache *cache, unsigned long flags)
 {
        struct file_lock *lock = (struct file_lock *) foo;
 
-       if (!(flags & SLAB_CTOR_CONSTRUCTOR))
-               return;
-
        locks_init_lock(lock);
 }
 
index 2f4d43a2a3105e76d00f98a3cf060c9f6ab250b2..be4044614ac83374672d90cacb406aee004375ee 100644 (file)
@@ -73,8 +73,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct minix_inode_info *ei = (struct minix_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index c29f00ad495d99640173c324b3e3c2608e5adbb4..cf06eb9f050e31db04c2852832471358a790272c 100644 (file)
@@ -60,10 +60,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               mutex_init(&ei->open_mutex);
-               inode_init_once(&ei->vfs_inode);
-       }
+       mutex_init(&ei->open_mutex);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 2a3fd9573207ac81faa4b34ad22a269a8f11b36a..2b26ad7c97708d5a759beebaf7bbfa0426b1a98e 100644 (file)
@@ -1164,21 +1164,19 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct nfs_inode *nfsi = (struct nfs_inode *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               inode_init_once(&nfsi->vfs_inode);
-               spin_lock_init(&nfsi->req_lock);
-               INIT_LIST_HEAD(&nfsi->dirty);
-               INIT_LIST_HEAD(&nfsi->commit);
-               INIT_LIST_HEAD(&nfsi->open_files);
-               INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
-               INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
-               INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
-               atomic_set(&nfsi->data_updates, 0);
-               nfsi->ndirty = 0;
-               nfsi->ncommit = 0;
-               nfsi->npages = 0;
-               nfs4_init_once(nfsi);
-       }
+       inode_init_once(&nfsi->vfs_inode);
+       spin_lock_init(&nfsi->req_lock);
+       INIT_LIST_HEAD(&nfsi->dirty);
+       INIT_LIST_HEAD(&nfsi->commit);
+       INIT_LIST_HEAD(&nfsi->open_files);
+       INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
+       INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
+       INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
+       atomic_set(&nfsi->data_updates, 0);
+       nfsi->ndirty = 0;
+       nfsi->ncommit = 0;
+       nfsi->npages = 0;
+       nfs4_init_once(nfsi);
 }
  
 static int __init nfs_init_inodecache(void)
index 21d834e5ed733324a5226099e9b83adfc2a26133..4566b9182551cdaf004a5057e1311b9c5eb86b49 100644 (file)
@@ -3085,8 +3085,7 @@ static void ntfs_big_inode_init_once(void *foo, struct kmem_cache *cachep,
 {
        ntfs_inode *ni = (ntfs_inode *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(VFS_I(ni));
+       inode_init_once(VFS_I(ni));
 }
 
 /*
index 5671cf9d6383529a0b0c278ce304fcf2fc1ebeca..fd8cb1badc9b9db082219a170f8240c3675cf72a 100644 (file)
@@ -262,12 +262,10 @@ static void dlmfs_init_once(void *foo,
        struct dlmfs_inode_private *ip =
                (struct dlmfs_inode_private *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               ip->ip_dlm = NULL;
-               ip->ip_parent = NULL;
+       ip->ip_dlm = NULL;
+       ip->ip_parent = NULL;
 
-               inode_init_once(&ip->ip_vfs_inode);
-       }
+       inode_init_once(&ip->ip_vfs_inode);
 }
 
 static struct inode *dlmfs_alloc_inode(struct super_block *sb)
index 7c5e3f5d66345e77fbd5d4895c395f5c3217cc9c..86b559c7dce9a0ec697c54782c15710a8e5cb6ab 100644 (file)
@@ -937,31 +937,29 @@ static void ocfs2_inode_init_once(void *data,
 {
        struct ocfs2_inode_info *oi = data;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               oi->ip_flags = 0;
-               oi->ip_open_count = 0;
-               spin_lock_init(&oi->ip_lock);
-               ocfs2_extent_map_init(&oi->vfs_inode);
-               INIT_LIST_HEAD(&oi->ip_io_markers);
-               oi->ip_created_trans = 0;
-               oi->ip_last_trans = 0;
-               oi->ip_dir_start_lookup = 0;
+       oi->ip_flags = 0;
+       oi->ip_open_count = 0;
+       spin_lock_init(&oi->ip_lock);
+       ocfs2_extent_map_init(&oi->vfs_inode);
+       INIT_LIST_HEAD(&oi->ip_io_markers);
+       oi->ip_created_trans = 0;
+       oi->ip_last_trans = 0;
+       oi->ip_dir_start_lookup = 0;
 
-               init_rwsem(&oi->ip_alloc_sem);
-               mutex_init(&oi->ip_io_mutex);
+       init_rwsem(&oi->ip_alloc_sem);
+       mutex_init(&oi->ip_io_mutex);
 
-               oi->ip_blkno = 0ULL;
-               oi->ip_clusters = 0;
+       oi->ip_blkno = 0ULL;
+       oi->ip_clusters = 0;
 
-               ocfs2_lock_res_init_once(&oi->ip_rw_lockres);
-               ocfs2_lock_res_init_once(&oi->ip_meta_lockres);
-               ocfs2_lock_res_init_once(&oi->ip_data_lockres);
-               ocfs2_lock_res_init_once(&oi->ip_open_lockres);
+       ocfs2_lock_res_init_once(&oi->ip_rw_lockres);
+       ocfs2_lock_res_init_once(&oi->ip_meta_lockres);
+       ocfs2_lock_res_init_once(&oi->ip_data_lockres);
+       ocfs2_lock_res_init_once(&oi->ip_open_lockres);
 
-               ocfs2_metadata_cache_init(&oi->vfs_inode);
+       ocfs2_metadata_cache_init(&oi->vfs_inode);
 
-               inode_init_once(&oi->vfs_inode);
-       }
+       inode_init_once(&oi->vfs_inode);
 }
 
 static int ocfs2_initialize_mem_caches(void)
index 731a90e9f0cd1bee31c16bb5912300ef3eee8102..e62397341c363fa31bbc656cd59120320786a55d 100644 (file)
@@ -419,8 +419,7 @@ static void op_inode_init_once(void *data, struct kmem_cache * cachep, unsigned
 {
        struct op_inode_info *oi = (struct op_inode_info *) data;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&oi->vfs_inode);
+       inode_init_once(&oi->vfs_inode);
 }
 
 static int __init init_openprom_fs(void)
index b8171907c83b64e30ce98bf6553c7feff60768e1..d5ce65c68d7b2b538a87c0a58de0863941db6ff3 100644 (file)
@@ -109,8 +109,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct proc_inode *ei = (struct proc_inode *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 int __init proc_init_inodecache(void)
index 75fc8498f2e29894336a3acd07e14af06c30cdcc..8d256eb118130130b5738f278114f9424f381e86 100644 (file)
@@ -536,8 +536,7 @@ static void init_once(void *foo, struct kmem_cache * cachep,
 {
        struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int init_inodecache(void)
index c7762140c4258a3ef8c867236a25da67ad38e51f..b4ac9119200e6bbba5e6cd086139c8d4dbcae476 100644 (file)
@@ -511,14 +511,12 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
 {
        struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               INIT_LIST_HEAD(&ei->i_prealloc_list);
-               inode_init_once(&ei->vfs_inode);
+       INIT_LIST_HEAD(&ei->i_prealloc_list);
+       inode_init_once(&ei->vfs_inode);
 #ifdef CONFIG_REISERFS_FS_POSIX_ACL
-               ei->i_acl_access = NULL;
-               ei->i_acl_default = NULL;
+       ei->i_acl_access = NULL;
+       ei->i_acl_default = NULL;
 #endif
-       }
 }
 
 static int init_inodecache(void)
index 804285190271827ac324be4cfad7449a66a115da..2284e03342c6af7367d9fb602732f709cba98d48 100644 (file)
@@ -566,12 +566,11 @@ static void romfs_destroy_inode(struct inode *inode)
        kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode));
 }
 
-static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
+static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
-       struct romfs_inode_info *ei = (struct romfs_inode_info *) foo;
+       struct romfs_inode_info *ei = foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 424a3ddf86dd38c1187f352be95f180ddf682ea2..5c9243a23b9bd8b4454c1d93c30e95b1c4ddd1d6 100644 (file)
@@ -70,8 +70,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct smb_inode_info *ei = (struct smb_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 3152d7415606711fa168b4e9f5f459d5c13f125c..564411693394581a51ad421b78bfd7e54bbdc658 100644 (file)
@@ -322,8 +322,7 @@ static void init_once(void *p, struct kmem_cache *cachep, unsigned long flags)
 {
        struct sysv_inode_info *si = (struct sysv_inode_info *)p;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&si->vfs_inode);
+       inode_init_once(&si->vfs_inode);
 }
 
 const struct super_operations sysv_sops = {
index 9b8644a06e53b98f257a54198abb8894abbab85d..3a743d854c17bf9408b8114d0b44ead19fe18b1e 100644 (file)
@@ -134,10 +134,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct udf_inode_info *ei = (struct udf_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               ei->i_ext.i_data = NULL;
-               inode_init_once(&ei->vfs_inode);
-       }
+       ei->i_ext.i_data = NULL;
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int init_inodecache(void)
index be7c48c5f203f11c7c0a079ae1628a89ea7fdfa4..22ff6ed55ce9a2d685024bfadf3aabb1eed68fa5 100644 (file)
@@ -1237,8 +1237,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 {
        struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
  
 static int init_inodecache(void)
index 14e2cbe5a8d543bdd1cc1ef502b3d49e04ca53d0..bf9a9d5909be0b714285f192710695578dd344de 100644 (file)
@@ -360,8 +360,7 @@ xfs_fs_inode_init_once(
        kmem_zone_t             *zonep,
        unsigned long           flags)
 {
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
+       inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
 }
 
 STATIC int
index 5dbc0bae26e3659c312924bc5a5b68ca87cf67f8..6fb2ae214152b5e8b733eaceb2748e4af79d807f 100644 (file)
@@ -32,9 +32,6 @@ typedef struct kmem_cache kmem_cache_t __deprecated;
 #define SLAB_MEM_SPREAD                0x00100000UL    /* Spread some memory over cpuset */
 #define SLAB_TRACE             0x00200000UL    /* Trace allocations and frees */
 
-/* Flags passed to a constructor functions */
-#define SLAB_CTOR_CONSTRUCTOR  0x001UL         /* If not set, then deconstructor */
-
 /*
  * struct kmem_cache related prototypes
  */
index fab5707cb5f720377a37ba370da212856ce7cf51..a242c83d89d604a364fb447a66e59d47856478e0 100644 (file)
@@ -215,8 +215,7 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
 {
        struct mqueue_inode_info *p = (struct mqueue_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&p->vfs_inode);
+       inode_init_once(&p->vfs_inode);
 }
 
 static struct inode *mqueue_alloc_inode(struct super_block *sb)
index 49530e40ea8b7e6a7d6c1725f42312bd5161ad2a..87069cfc18a126f5344f1d2ac77309b1eb72e7fc 100644 (file)
@@ -1427,10 +1427,8 @@ static void sighand_ctor(void *data, struct kmem_cache *cachep,
 {
        struct sighand_struct *sighand = data;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               spin_lock_init(&sighand->siglock);
-               INIT_LIST_HEAD(&sighand->signalfd_list);
-       }
+       spin_lock_init(&sighand->siglock);
+       INIT_LIST_HEAD(&sighand->signalfd_list);
 }
 
 void __init proc_caches_init(void)
index 304f51985c78504cb67056922bfd2bb7c34a6e21..1c1af92732d508c6e8e6039a7898e402c99c2fdb 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -162,12 +162,10 @@ void anon_vma_unlink(struct vm_area_struct *vma)
 static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
                          unsigned long flags)
 {
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               struct anon_vma *anon_vma = data;
+       struct anon_vma *anon_vma = data;
 
-               spin_lock_init(&anon_vma->lock);
-               INIT_LIST_HEAD(&anon_vma->head);
-       }
+       spin_lock_init(&anon_vma->lock);
+       INIT_LIST_HEAD(&anon_vma->head);
 }
 
 void __init anon_vma_init(void)
index f01e8deed645b6f0459451e0615a9f8b1e901104..e537317bec4d5d02977bf92021d87242e2ff549b 100644 (file)
@@ -2358,13 +2358,11 @@ static void init_once(void *foo, struct kmem_cache *cachep,
 {
        struct shmem_inode_info *p = (struct shmem_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               inode_init_once(&p->vfs_inode);
+       inode_init_once(&p->vfs_inode);
 #ifdef CONFIG_TMPFS_POSIX_ACL
-               p->i_acl = NULL;
-               p->i_default_acl = NULL;
+       p->i_acl = NULL;
+       p->i_default_acl = NULL;
 #endif
-       }
 }
 
 static int init_inodecache(void)
index 2043102c0425ecb711f994c9e201e5765c11ab2b..1dc0ce1d0d5ddc81c10c95c10e283dc909a6a3b4 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2610,7 +2610,7 @@ static inline kmem_bufctl_t *slab_bufctl(struct slab *slabp)
 }
 
 static void cache_init_objs(struct kmem_cache *cachep,
-                           struct slab *slabp, unsigned long ctor_flags)
+                           struct slab *slabp)
 {
        int i;
 
@@ -2634,7 +2634,7 @@ static void cache_init_objs(struct kmem_cache *cachep,
                 */
                if (cachep->ctor && !(cachep->flags & SLAB_POISON))
                        cachep->ctor(objp + obj_offset(cachep), cachep,
-                                    ctor_flags);
+                                    0);
 
                if (cachep->flags & SLAB_RED_ZONE) {
                        if (*dbg_redzone2(cachep, objp) != RED_INACTIVE)
@@ -2650,7 +2650,7 @@ static void cache_init_objs(struct kmem_cache *cachep,
                                         cachep->buffer_size / PAGE_SIZE, 0);
 #else
                if (cachep->ctor)
-                       cachep->ctor(objp, cachep, ctor_flags);
+                       cachep->ctor(objp, cachep, 0);
 #endif
                slab_bufctl(slabp)[i] = i + 1;
        }
@@ -2739,7 +2739,6 @@ static int cache_grow(struct kmem_cache *cachep,
        struct slab *slabp;
        size_t offset;
        gfp_t local_flags;
-       unsigned long ctor_flags;
        struct kmem_list3 *l3;
 
        /*
@@ -2748,7 +2747,6 @@ static int cache_grow(struct kmem_cache *cachep,
         */
        BUG_ON(flags & ~(GFP_DMA | GFP_LEVEL_MASK));
 
-       ctor_flags = SLAB_CTOR_CONSTRUCTOR;
        local_flags = (flags & GFP_LEVEL_MASK);
        /* Take the l3 list lock to change the colour_next on this node */
        check_irq_off();
@@ -2793,7 +2791,7 @@ static int cache_grow(struct kmem_cache *cachep,
        slabp->nodeid = nodeid;
        slab_map_pages(cachep, slabp, objp);
 
-       cache_init_objs(cachep, slabp, ctor_flags);
+       cache_init_objs(cachep, slabp);
 
        if (local_flags & __GFP_WAIT)
                local_irq_disable();
@@ -3077,7 +3075,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
 #endif
        objp += obj_offset(cachep);
        if (cachep->ctor && cachep->flags & SLAB_POISON)
-               cachep->ctor(objp, cachep, SLAB_CTOR_CONSTRUCTOR);
+               cachep->ctor(objp, cachep, 0);
 #if ARCH_SLAB_MINALIGN
        if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
                printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
index 79164a4f54ad2d64e7f4e8a5158b9cdc09682efd..71976c5d40d301373ea9bc3f807553dde819c195 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -327,7 +327,7 @@ void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags)
                b = (void *)__get_free_pages(flags, get_order(c->size));
 
        if (c->ctor)
-               c->ctor(b, c, SLAB_CTOR_CONSTRUCTOR);
+               c->ctor(b, c, 0);
 
        return b;
 }
index 3ca164f339651416515aa6fec9b3f88bd9b98137..e7ad123bb6a745be4ac1a62dd6f23152a3ff0536 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -994,7 +994,7 @@ static void setup_object(struct kmem_cache *s, struct page *page,
        }
 
        if (unlikely(s->ctor))
-               s->ctor(object, s, SLAB_CTOR_CONSTRUCTOR);
+               s->ctor(object, s, 0);
 }
 
 static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
index 98a8f67abbfcfe84f2cb026737c710c39647d8cc..f4530196a70a30c10f87450ad47bdfaa9e28f925 100644 (file)
@@ -261,8 +261,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
        struct socket_alloc *ei = (struct socket_alloc *)foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
 
 static int init_inodecache(void)
index a2f1893bde53e41137a96b3cee5de618a629c2b9..5887457dc936d06244404183627fa989f70d24fe 100644 (file)
@@ -828,19 +828,17 @@ init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
 {
        struct rpc_inode *rpci = (struct rpc_inode *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR) {
-               inode_init_once(&rpci->vfs_inode);
-               rpci->private = NULL;
-               rpci->nreaders = 0;
-               rpci->nwriters = 0;
-               INIT_LIST_HEAD(&rpci->in_upcall);
-               INIT_LIST_HEAD(&rpci->pipe);
-               rpci->pipelen = 0;
-               init_waitqueue_head(&rpci->waitq);
-               INIT_DELAYED_WORK(&rpci->queue_timeout,
-                                   rpc_timeout_upcall_queue);
-               rpci->ops = NULL;
-       }
+       inode_init_once(&rpci->vfs_inode);
+       rpci->private = NULL;
+       rpci->nreaders = 0;
+       rpci->nwriters = 0;
+       INIT_LIST_HEAD(&rpci->in_upcall);
+       INIT_LIST_HEAD(&rpci->pipe);
+       rpci->pipelen = 0;
+       init_waitqueue_head(&rpci->waitq);
+       INIT_DELAYED_WORK(&rpci->queue_timeout,
+                           rpc_timeout_upcall_queue);
+       rpci->ops = NULL;
 }
 
 int register_rpc_pipefs(void)