Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Remove SLAB_CTOR_CONSTRUCTOR

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>

authored by

Christoph Lameter and committed by
Linus Torvalds
a35afb83 5577bd8a

+178 -277
+1 -3
arch/powerpc/platforms/cell/spufs/inode.c
··· 71 71 { 72 72 struct spufs_inode_info *ei = p; 73 73 74 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 75 - inode_init_once(&ei->vfs_inode); 76 - } 74 + inode_init_once(&ei->vfs_inode); 77 75 } 78 76 79 77 static struct inode *
-3
drivers/mtd/ubi/eba.c
··· 940 940 { 941 941 struct ltree_entry *le = obj; 942 942 943 - if (flags & SLAB_CTOR_CONSTRUCTOR) 944 - return; 945 - 946 943 le->users = 0; 947 944 init_rwsem(&le->mutex); 948 945 }
+1 -2
fs/adfs/super.c
··· 232 232 { 233 233 struct adfs_inode_info *ei = (struct adfs_inode_info *) foo; 234 234 235 - if (flags & SLAB_CTOR_CONSTRUCTOR) 236 - inode_init_once(&ei->vfs_inode); 235 + inode_init_once(&ei->vfs_inode); 237 236 } 238 237 239 238 static int init_inodecache(void)
+3 -5
fs/affs/super.c
··· 87 87 { 88 88 struct affs_inode_info *ei = (struct affs_inode_info *) foo; 89 89 90 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 91 - init_MUTEX(&ei->i_link_lock); 92 - init_MUTEX(&ei->i_ext_lock); 93 - inode_init_once(&ei->vfs_inode); 94 - } 90 + init_MUTEX(&ei->i_link_lock); 91 + init_MUTEX(&ei->i_ext_lock); 92 + inode_init_once(&ei->vfs_inode); 95 93 } 96 94 97 95 static int init_inodecache(void)
+9 -11
fs/afs/super.c
··· 451 451 { 452 452 struct afs_vnode *vnode = _vnode; 453 453 454 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 455 - memset(vnode, 0, sizeof(*vnode)); 456 - inode_init_once(&vnode->vfs_inode); 457 - init_waitqueue_head(&vnode->update_waitq); 458 - mutex_init(&vnode->permits_lock); 459 - mutex_init(&vnode->validate_lock); 460 - spin_lock_init(&vnode->writeback_lock); 461 - spin_lock_init(&vnode->lock); 462 - INIT_LIST_HEAD(&vnode->writebacks); 463 - INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work); 464 - } 454 + memset(vnode, 0, sizeof(*vnode)); 455 + inode_init_once(&vnode->vfs_inode); 456 + init_waitqueue_head(&vnode->update_waitq); 457 + mutex_init(&vnode->permits_lock); 458 + mutex_init(&vnode->validate_lock); 459 + spin_lock_init(&vnode->writeback_lock); 460 + spin_lock_init(&vnode->lock); 461 + INIT_LIST_HEAD(&vnode->writebacks); 462 + INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work); 465 463 } 466 464 467 465 /*
+2 -4
fs/befs/linuxvfs.c
··· 292 292 static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) 293 293 { 294 294 struct befs_inode_info *bi = (struct befs_inode_info *) foo; 295 - 296 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 297 - inode_init_once(&bi->vfs_inode); 298 - } 295 + 296 + inode_init_once(&bi->vfs_inode); 299 297 } 300 298 301 299 static void
+1 -2
fs/bfs/inode.c
··· 248 248 { 249 249 struct bfs_inode_info *bi = foo; 250 250 251 - if (flags & SLAB_CTOR_CONSTRUCTOR) 252 - inode_init_once(&bi->vfs_inode); 251 + inode_init_once(&bi->vfs_inode); 253 252 } 254 253 255 254 static int init_inodecache(void)
+7 -9
fs/block_dev.c
··· 458 458 struct bdev_inode *ei = (struct bdev_inode *) foo; 459 459 struct block_device *bdev = &ei->bdev; 460 460 461 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 462 - memset(bdev, 0, sizeof(*bdev)); 463 - mutex_init(&bdev->bd_mutex); 464 - sema_init(&bdev->bd_mount_sem, 1); 465 - INIT_LIST_HEAD(&bdev->bd_inodes); 466 - INIT_LIST_HEAD(&bdev->bd_list); 461 + memset(bdev, 0, sizeof(*bdev)); 462 + mutex_init(&bdev->bd_mutex); 463 + sema_init(&bdev->bd_mount_sem, 1); 464 + INIT_LIST_HEAD(&bdev->bd_inodes); 465 + INIT_LIST_HEAD(&bdev->bd_list); 467 466 #ifdef CONFIG_SYSFS 468 - INIT_LIST_HEAD(&bdev->bd_holder_list); 467 + INIT_LIST_HEAD(&bdev->bd_holder_list); 469 468 #endif 470 - inode_init_once(&ei->vfs_inode); 471 - } 469 + inode_init_once(&ei->vfs_inode); 472 470 } 473 471 474 472 static inline void __bd_forget(struct inode *inode)
+4 -18
fs/buffer.c
··· 2898 2898 2899 2899 struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) 2900 2900 { 2901 - struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); 2901 + struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags); 2902 2902 if (ret) { 2903 + INIT_LIST_HEAD(&ret->b_assoc_buffers); 2903 2904 get_cpu_var(bh_accounting).nr++; 2904 2905 recalc_bh_state(); 2905 2906 put_cpu_var(bh_accounting); ··· 2918 2917 put_cpu_var(bh_accounting); 2919 2918 } 2920 2919 EXPORT_SYMBOL(free_buffer_head); 2921 - 2922 - static void 2923 - init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags) 2924 - { 2925 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 2926 - struct buffer_head * bh = (struct buffer_head *)data; 2927 - 2928 - memset(bh, 0, sizeof(*bh)); 2929 - INIT_LIST_HEAD(&bh->b_assoc_buffers); 2930 - } 2931 - } 2932 2920 2933 2921 static void buffer_exit_cpu(int cpu) 2934 2922 { ··· 2945 2955 { 2946 2956 int nrpages; 2947 2957 2948 - bh_cachep = kmem_cache_create("buffer_head", 2949 - sizeof(struct buffer_head), 0, 2950 - (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 2951 - SLAB_MEM_SPREAD), 2952 - init_buffer_head, 2953 - NULL); 2958 + bh_cachep = KMEM_CACHE(buffer_head, 2959 + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD); 2954 2960 2955 2961 /* 2956 2962 * Limit the bh occupancy to 10% of ZONE_NORMAL
+2 -4
fs/cifs/cifsfs.c
··· 701 701 { 702 702 struct cifsInodeInfo *cifsi = inode; 703 703 704 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 705 - inode_init_once(&cifsi->vfs_inode); 706 - INIT_LIST_HEAD(&cifsi->lockList); 707 - } 704 + inode_init_once(&cifsi->vfs_inode); 705 + INIT_LIST_HEAD(&cifsi->lockList); 708 706 } 709 707 710 708 static int
+1 -2
fs/coda/inode.c
··· 62 62 { 63 63 struct coda_inode_info *ei = (struct coda_inode_info *) foo; 64 64 65 - if (flags & SLAB_CTOR_CONSTRUCTOR) 66 - inode_init_once(&ei->vfs_inode); 65 + inode_init_once(&ei->vfs_inode); 67 66 } 68 67 69 68 int coda_init_inodecache(void)
+1 -2
fs/ecryptfs/main.c
··· 583 583 { 584 584 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr; 585 585 586 - if (flags & SLAB_CTOR_CONSTRUCTOR) 587 - inode_init_once(&ei->vfs_inode); 586 + inode_init_once(&ei->vfs_inode); 588 587 } 589 588 590 589 static struct ecryptfs_cache_info {
+1 -2
fs/efs/super.c
··· 72 72 { 73 73 struct efs_inode_info *ei = (struct efs_inode_info *) foo; 74 74 75 - if (flags & SLAB_CTOR_CONSTRUCTOR) 76 - inode_init_once(&ei->vfs_inode); 75 + inode_init_once(&ei->vfs_inode); 77 76 } 78 77 79 78 static int init_inodecache(void)
+3 -5
fs/ext2/super.c
··· 160 160 { 161 161 struct ext2_inode_info *ei = (struct ext2_inode_info *) foo; 162 162 163 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 164 - rwlock_init(&ei->i_meta_lock); 163 + rwlock_init(&ei->i_meta_lock); 165 164 #ifdef CONFIG_EXT2_FS_XATTR 166 - init_rwsem(&ei->xattr_sem); 165 + init_rwsem(&ei->xattr_sem); 167 166 #endif 168 - inode_init_once(&ei->vfs_inode); 169 - } 167 + inode_init_once(&ei->vfs_inode); 170 168 } 171 169 172 170 static int init_inodecache(void)
+4 -6
fs/ext3/super.c
··· 466 466 { 467 467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo; 468 468 469 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 470 - INIT_LIST_HEAD(&ei->i_orphan); 469 + INIT_LIST_HEAD(&ei->i_orphan); 471 470 #ifdef CONFIG_EXT3_FS_XATTR 472 - init_rwsem(&ei->xattr_sem); 471 + init_rwsem(&ei->xattr_sem); 473 472 #endif 474 - mutex_init(&ei->truncate_mutex); 475 - inode_init_once(&ei->vfs_inode); 476 - } 473 + mutex_init(&ei->truncate_mutex); 474 + inode_init_once(&ei->vfs_inode); 477 475 } 478 476 479 477 static int init_inodecache(void)
+4 -6
fs/ext4/super.c
··· 517 517 { 518 518 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; 519 519 520 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 521 - INIT_LIST_HEAD(&ei->i_orphan); 520 + INIT_LIST_HEAD(&ei->i_orphan); 522 521 #ifdef CONFIG_EXT4DEV_FS_XATTR 523 - init_rwsem(&ei->xattr_sem); 522 + init_rwsem(&ei->xattr_sem); 524 523 #endif 525 - mutex_init(&ei->truncate_mutex); 526 - inode_init_once(&ei->vfs_inode); 527 - } 524 + mutex_init(&ei->truncate_mutex); 525 + inode_init_once(&ei->vfs_inode); 528 526 } 529 527 530 528 static int init_inodecache(void)
+1 -2
fs/fat/cache.c
··· 40 40 { 41 41 struct fat_cache *cache = (struct fat_cache *)foo; 42 42 43 - if (flags & SLAB_CTOR_CONSTRUCTOR) 44 - INIT_LIST_HEAD(&cache->cache_list); 43 + INIT_LIST_HEAD(&cache->cache_list); 45 44 } 46 45 47 46 int __init fat_cache_init(void)
+6 -8
fs/fat/inode.c
··· 500 500 { 501 501 struct msdos_inode_info *ei = (struct msdos_inode_info *)foo; 502 502 503 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 504 - spin_lock_init(&ei->cache_lru_lock); 505 - ei->nr_caches = 0; 506 - ei->cache_valid_id = FAT_CACHE_VALID + 1; 507 - INIT_LIST_HEAD(&ei->cache_lru); 508 - INIT_HLIST_NODE(&ei->i_fat_hash); 509 - inode_init_once(&ei->vfs_inode); 510 - } 503 + spin_lock_init(&ei->cache_lru_lock); 504 + ei->nr_caches = 0; 505 + ei->cache_valid_id = FAT_CACHE_VALID + 1; 506 + INIT_LIST_HEAD(&ei->cache_lru); 507 + INIT_HLIST_NODE(&ei->i_fat_hash); 508 + inode_init_once(&ei->vfs_inode); 511 509 } 512 510 513 511 static int __init fat_init_inodecache(void)
+1 -2
fs/fuse/inode.c
··· 687 687 { 688 688 struct inode * inode = foo; 689 689 690 - if (flags & SLAB_CTOR_CONSTRUCTOR) 691 - inode_init_once(inode); 690 + inode_init_once(inode); 692 691 } 693 692 694 693 static int __init fuse_fs_init(void)
+16 -18
fs/gfs2/main.c
··· 27 27 static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 28 28 { 29 29 struct gfs2_inode *ip = foo; 30 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 31 - inode_init_once(&ip->i_inode); 32 - spin_lock_init(&ip->i_spin); 33 - init_rwsem(&ip->i_rw_mutex); 34 - memset(ip->i_cache, 0, sizeof(ip->i_cache)); 35 - } 30 + 31 + inode_init_once(&ip->i_inode); 32 + spin_lock_init(&ip->i_spin); 33 + init_rwsem(&ip->i_rw_mutex); 34 + memset(ip->i_cache, 0, sizeof(ip->i_cache)); 36 35 } 37 36 38 37 static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 39 38 { 40 39 struct gfs2_glock *gl = foo; 41 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 42 - INIT_HLIST_NODE(&gl->gl_list); 43 - spin_lock_init(&gl->gl_spin); 44 - INIT_LIST_HEAD(&gl->gl_holders); 45 - INIT_LIST_HEAD(&gl->gl_waiters1); 46 - INIT_LIST_HEAD(&gl->gl_waiters3); 47 - gl->gl_lvb = NULL; 48 - atomic_set(&gl->gl_lvb_count, 0); 49 - INIT_LIST_HEAD(&gl->gl_reclaim); 50 - INIT_LIST_HEAD(&gl->gl_ail_list); 51 - atomic_set(&gl->gl_ail_count, 0); 52 - } 40 + 41 + INIT_HLIST_NODE(&gl->gl_list); 42 + spin_lock_init(&gl->gl_spin); 43 + INIT_LIST_HEAD(&gl->gl_holders); 44 + INIT_LIST_HEAD(&gl->gl_waiters1); 45 + INIT_LIST_HEAD(&gl->gl_waiters3); 46 + gl->gl_lvb = NULL; 47 + atomic_set(&gl->gl_lvb_count, 0); 48 + INIT_LIST_HEAD(&gl->gl_reclaim); 49 + INIT_LIST_HEAD(&gl->gl_ail_list); 50 + atomic_set(&gl->gl_ail_count, 0); 53 51 } 54 52 55 53 /**
+1 -2
fs/hfs/super.c
··· 434 434 { 435 435 struct hfs_inode_info *i = p; 436 436 437 - if (flags & SLAB_CTOR_CONSTRUCTOR) 438 - inode_init_once(&i->vfs_inode); 437 + inode_init_once(&i->vfs_inode); 439 438 } 440 439 441 440 static int __init init_hfs_fs(void)
+1 -2
fs/hfsplus/super.c
··· 470 470 { 471 471 struct hfsplus_inode_info *i = p; 472 472 473 - if (flags & SLAB_CTOR_CONSTRUCTOR) 474 - inode_init_once(&i->vfs_inode); 473 + inode_init_once(&i->vfs_inode); 475 474 } 476 475 477 476 static int __init init_hfsplus_fs(void)
+3 -5
fs/hpfs/super.c
··· 176 176 { 177 177 struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo; 178 178 179 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 180 - mutex_init(&ei->i_mutex); 181 - mutex_init(&ei->i_parent_mutex); 182 - inode_init_once(&ei->vfs_inode); 183 - } 179 + mutex_init(&ei->i_mutex); 180 + mutex_init(&ei->i_parent_mutex); 181 + inode_init_once(&ei->vfs_inode); 184 182 } 185 183 186 184 static int init_inodecache(void)
+1 -2
fs/hugetlbfs/inode.c
··· 556 556 { 557 557 struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo; 558 558 559 - if (flags & SLAB_CTOR_CONSTRUCTOR) 560 - inode_init_once(&ei->vfs_inode); 559 + inode_init_once(&ei->vfs_inode); 561 560 } 562 561 563 562 const struct file_operations hugetlbfs_file_operations = {
+1 -2
fs/inode.c
··· 213 213 { 214 214 struct inode * inode = (struct inode *) foo; 215 215 216 - if (flags & SLAB_CTOR_CONSTRUCTOR) 217 - inode_init_once(inode); 216 + inode_init_once(inode); 218 217 } 219 218 220 219 /*
+1 -2
fs/isofs/inode.c
··· 77 77 { 78 78 struct iso_inode_info *ei = foo; 79 79 80 - if (flags & SLAB_CTOR_CONSTRUCTOR) 81 - inode_init_once(&ei->vfs_inode); 80 + inode_init_once(&ei->vfs_inode); 82 81 } 83 82 84 83 static int init_inodecache(void)
+2 -4
fs/jffs2/super.c
··· 47 47 { 48 48 struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo; 49 49 50 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 51 - init_MUTEX(&ei->sem); 52 - inode_init_once(&ei->vfs_inode); 53 - } 50 + init_MUTEX(&ei->sem); 51 + inode_init_once(&ei->vfs_inode); 54 52 } 55 53 56 54 static int jffs2_sync_fs(struct super_block *sb, int wait)
+8 -10
fs/jfs/jfs_metapage.c
··· 184 184 { 185 185 struct metapage *mp = (struct metapage *)foo; 186 186 187 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 188 - mp->lid = 0; 189 - mp->lsn = 0; 190 - mp->flag = 0; 191 - mp->data = NULL; 192 - mp->clsn = 0; 193 - mp->log = NULL; 194 - set_bit(META_free, &mp->flag); 195 - init_waitqueue_head(&mp->wait); 196 - } 187 + mp->lid = 0; 188 + mp->lsn = 0; 189 + mp->flag = 0; 190 + mp->data = NULL; 191 + mp->clsn = 0; 192 + mp->log = NULL; 193 + set_bit(META_free, &mp->flag); 194 + init_waitqueue_head(&mp->wait); 197 195 } 198 196 199 197 static inline struct metapage *alloc_metapage(gfp_t gfp_mask)
+10 -12
fs/jfs/super.c
··· 752 752 { 753 753 struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo; 754 754 755 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 756 - memset(jfs_ip, 0, sizeof(struct jfs_inode_info)); 757 - INIT_LIST_HEAD(&jfs_ip->anon_inode_list); 758 - init_rwsem(&jfs_ip->rdwrlock); 759 - mutex_init(&jfs_ip->commit_mutex); 760 - init_rwsem(&jfs_ip->xattr_sem); 761 - spin_lock_init(&jfs_ip->ag_lock); 762 - jfs_ip->active_ag = -1; 755 + memset(jfs_ip, 0, sizeof(struct jfs_inode_info)); 756 + INIT_LIST_HEAD(&jfs_ip->anon_inode_list); 757 + init_rwsem(&jfs_ip->rdwrlock); 758 + mutex_init(&jfs_ip->commit_mutex); 759 + init_rwsem(&jfs_ip->xattr_sem); 760 + spin_lock_init(&jfs_ip->ag_lock); 761 + jfs_ip->active_ag = -1; 763 762 #ifdef CONFIG_JFS_POSIX_ACL 764 - jfs_ip->i_acl = JFS_ACL_NOT_CACHED; 765 - jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED; 763 + jfs_ip->i_acl = JFS_ACL_NOT_CACHED; 764 + jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED; 766 765 #endif 767 - inode_init_once(&jfs_ip->vfs_inode); 768 - } 766 + inode_init_once(&jfs_ip->vfs_inode); 769 767 } 770 768 771 769 static int __init init_jfs_fs(void)
-3
fs/locks.c
··· 203 203 { 204 204 struct file_lock *lock = (struct file_lock *) foo; 205 205 206 - if (!(flags & SLAB_CTOR_CONSTRUCTOR)) 207 - return; 208 - 209 206 locks_init_lock(lock); 210 207 } 211 208
+1 -2
fs/minix/inode.c
··· 73 73 { 74 74 struct minix_inode_info *ei = (struct minix_inode_info *) foo; 75 75 76 - if (flags & SLAB_CTOR_CONSTRUCTOR) 77 - inode_init_once(&ei->vfs_inode); 76 + inode_init_once(&ei->vfs_inode); 78 77 } 79 78 80 79 static int init_inodecache(void)
+2 -4
fs/ncpfs/inode.c
··· 60 60 { 61 61 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo; 62 62 63 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 64 - mutex_init(&ei->open_mutex); 65 - inode_init_once(&ei->vfs_inode); 66 - } 63 + mutex_init(&ei->open_mutex); 64 + inode_init_once(&ei->vfs_inode); 67 65 } 68 66 69 67 static int init_inodecache(void)
+13 -15
fs/nfs/inode.c
··· 1164 1164 { 1165 1165 struct nfs_inode *nfsi = (struct nfs_inode *) foo; 1166 1166 1167 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 1168 - inode_init_once(&nfsi->vfs_inode); 1169 - spin_lock_init(&nfsi->req_lock); 1170 - INIT_LIST_HEAD(&nfsi->dirty); 1171 - INIT_LIST_HEAD(&nfsi->commit); 1172 - INIT_LIST_HEAD(&nfsi->open_files); 1173 - INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); 1174 - INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); 1175 - INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC); 1176 - atomic_set(&nfsi->data_updates, 0); 1177 - nfsi->ndirty = 0; 1178 - nfsi->ncommit = 0; 1179 - nfsi->npages = 0; 1180 - nfs4_init_once(nfsi); 1181 - } 1167 + inode_init_once(&nfsi->vfs_inode); 1168 + spin_lock_init(&nfsi->req_lock); 1169 + INIT_LIST_HEAD(&nfsi->dirty); 1170 + INIT_LIST_HEAD(&nfsi->commit); 1171 + INIT_LIST_HEAD(&nfsi->open_files); 1172 + INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); 1173 + INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); 1174 + INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC); 1175 + atomic_set(&nfsi->data_updates, 0); 1176 + nfsi->ndirty = 0; 1177 + nfsi->ncommit = 0; 1178 + nfsi->npages = 0; 1179 + nfs4_init_once(nfsi); 1182 1180 } 1183 1181 1184 1182 static int __init nfs_init_inodecache(void)
+1 -2
fs/ntfs/super.c
··· 3085 3085 { 3086 3086 ntfs_inode *ni = (ntfs_inode *)foo; 3087 3087 3088 - if (flags & SLAB_CTOR_CONSTRUCTOR) 3089 - inode_init_once(VFS_I(ni)); 3088 + inode_init_once(VFS_I(ni)); 3090 3089 } 3091 3090 3092 3091 /*
+3 -5
fs/ocfs2/dlm/dlmfs.c
··· 262 262 struct dlmfs_inode_private *ip = 263 263 (struct dlmfs_inode_private *) foo; 264 264 265 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 266 - ip->ip_dlm = NULL; 267 - ip->ip_parent = NULL; 265 + ip->ip_dlm = NULL; 266 + ip->ip_parent = NULL; 268 267 269 - inode_init_once(&ip->ip_vfs_inode); 270 - } 268 + inode_init_once(&ip->ip_vfs_inode); 271 269 } 272 270 273 271 static struct inode *dlmfs_alloc_inode(struct super_block *sb)
+18 -20
fs/ocfs2/super.c
··· 937 937 { 938 938 struct ocfs2_inode_info *oi = data; 939 939 940 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 941 - oi->ip_flags = 0; 942 - oi->ip_open_count = 0; 943 - spin_lock_init(&oi->ip_lock); 944 - ocfs2_extent_map_init(&oi->vfs_inode); 945 - INIT_LIST_HEAD(&oi->ip_io_markers); 946 - oi->ip_created_trans = 0; 947 - oi->ip_last_trans = 0; 948 - oi->ip_dir_start_lookup = 0; 940 + oi->ip_flags = 0; 941 + oi->ip_open_count = 0; 942 + spin_lock_init(&oi->ip_lock); 943 + ocfs2_extent_map_init(&oi->vfs_inode); 944 + INIT_LIST_HEAD(&oi->ip_io_markers); 945 + oi->ip_created_trans = 0; 946 + oi->ip_last_trans = 0; 947 + oi->ip_dir_start_lookup = 0; 949 948 950 - init_rwsem(&oi->ip_alloc_sem); 951 - mutex_init(&oi->ip_io_mutex); 949 + init_rwsem(&oi->ip_alloc_sem); 950 + mutex_init(&oi->ip_io_mutex); 952 951 953 - oi->ip_blkno = 0ULL; 954 - oi->ip_clusters = 0; 952 + oi->ip_blkno = 0ULL; 953 + oi->ip_clusters = 0; 955 954 956 - ocfs2_lock_res_init_once(&oi->ip_rw_lockres); 957 - ocfs2_lock_res_init_once(&oi->ip_meta_lockres); 958 - ocfs2_lock_res_init_once(&oi->ip_data_lockres); 959 - ocfs2_lock_res_init_once(&oi->ip_open_lockres); 955 + ocfs2_lock_res_init_once(&oi->ip_rw_lockres); 956 + ocfs2_lock_res_init_once(&oi->ip_meta_lockres); 957 + ocfs2_lock_res_init_once(&oi->ip_data_lockres); 958 + ocfs2_lock_res_init_once(&oi->ip_open_lockres); 960 959 961 - ocfs2_metadata_cache_init(&oi->vfs_inode); 960 + ocfs2_metadata_cache_init(&oi->vfs_inode); 962 961 963 - inode_init_once(&oi->vfs_inode); 964 - } 962 + inode_init_once(&oi->vfs_inode); 965 963 } 966 964 967 965 static int ocfs2_initialize_mem_caches(void)
+1 -2
fs/openpromfs/inode.c
··· 419 419 { 420 420 struct op_inode_info *oi = (struct op_inode_info *) data; 421 421 422 - if (flags & SLAB_CTOR_CONSTRUCTOR) 423 - inode_init_once(&oi->vfs_inode); 422 + inode_init_once(&oi->vfs_inode); 424 423 } 425 424 426 425 static int __init init_openprom_fs(void)
+1 -2
fs/proc/inode.c
··· 109 109 { 110 110 struct proc_inode *ei = (struct proc_inode *) foo; 111 111 112 - if (flags & SLAB_CTOR_CONSTRUCTOR) 113 - inode_init_once(&ei->vfs_inode); 112 + inode_init_once(&ei->vfs_inode); 114 113 } 115 114 116 115 int __init proc_init_inodecache(void)
+1 -2
fs/qnx4/inode.c
··· 536 536 { 537 537 struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo; 538 538 539 - if (flags & SLAB_CTOR_CONSTRUCTOR) 540 - inode_init_once(&ei->vfs_inode); 539 + inode_init_once(&ei->vfs_inode); 541 540 } 542 541 543 542 static int init_inodecache(void)
+4 -6
fs/reiserfs/super.c
··· 511 511 { 512 512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo; 513 513 514 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 515 - INIT_LIST_HEAD(&ei->i_prealloc_list); 516 - inode_init_once(&ei->vfs_inode); 514 + INIT_LIST_HEAD(&ei->i_prealloc_list); 515 + inode_init_once(&ei->vfs_inode); 517 516 #ifdef CONFIG_REISERFS_FS_POSIX_ACL 518 - ei->i_acl_access = NULL; 519 - ei->i_acl_default = NULL; 517 + ei->i_acl_access = NULL; 518 + ei->i_acl_default = NULL; 520 519 #endif 521 - } 522 520 } 523 521 524 522 static int init_inodecache(void)
+3 -4
fs/romfs/inode.c
··· 566 566 kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode)); 567 567 } 568 568 569 - static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) 569 + static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 570 570 { 571 - struct romfs_inode_info *ei = (struct romfs_inode_info *) foo; 571 + struct romfs_inode_info *ei = foo; 572 572 573 - if (flags & SLAB_CTOR_CONSTRUCTOR) 574 - inode_init_once(&ei->vfs_inode); 573 + inode_init_once(&ei->vfs_inode); 575 574 } 576 575 577 576 static int init_inodecache(void)
+1 -2
fs/smbfs/inode.c
··· 70 70 { 71 71 struct smb_inode_info *ei = (struct smb_inode_info *) foo; 72 72 73 - if (flags & SLAB_CTOR_CONSTRUCTOR) 74 - inode_init_once(&ei->vfs_inode); 73 + inode_init_once(&ei->vfs_inode); 75 74 } 76 75 77 76 static int init_inodecache(void)
+1 -2
fs/sysv/inode.c
··· 322 322 { 323 323 struct sysv_inode_info *si = (struct sysv_inode_info *)p; 324 324 325 - if (flags & SLAB_CTOR_CONSTRUCTOR) 326 - inode_init_once(&si->vfs_inode); 325 + inode_init_once(&si->vfs_inode); 327 326 } 328 327 329 328 const struct super_operations sysv_sops = {
+2 -4
fs/udf/super.c
··· 134 134 { 135 135 struct udf_inode_info *ei = (struct udf_inode_info *) foo; 136 136 137 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 138 - ei->i_ext.i_data = NULL; 139 - inode_init_once(&ei->vfs_inode); 140 - } 137 + ei->i_ext.i_data = NULL; 138 + inode_init_once(&ei->vfs_inode); 141 139 } 142 140 143 141 static int init_inodecache(void)
+1 -2
fs/ufs/super.c
··· 1237 1237 { 1238 1238 struct ufs_inode_info *ei = (struct ufs_inode_info *) foo; 1239 1239 1240 - if (flags & SLAB_CTOR_CONSTRUCTOR) 1241 - inode_init_once(&ei->vfs_inode); 1240 + inode_init_once(&ei->vfs_inode); 1242 1241 } 1243 1242 1244 1243 static int init_inodecache(void)
+1 -2
fs/xfs/linux-2.6/xfs_super.c
··· 360 360 kmem_zone_t *zonep, 361 361 unsigned long flags) 362 362 { 363 - if (flags & SLAB_CTOR_CONSTRUCTOR) 364 - inode_init_once(vn_to_inode((bhv_vnode_t *)vnode)); 363 + inode_init_once(vn_to_inode((bhv_vnode_t *)vnode)); 365 364 } 366 365 367 366 STATIC int
-3
include/linux/slab.h
··· 32 32 #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 33 33 #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 34 34 35 - /* Flags passed to a constructor functions */ 36 - #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */ 37 - 38 35 /* 39 36 * struct kmem_cache related prototypes 40 37 */
+1 -2
ipc/mqueue.c
··· 215 215 { 216 216 struct mqueue_inode_info *p = (struct mqueue_inode_info *) foo; 217 217 218 - if (flags & SLAB_CTOR_CONSTRUCTOR) 219 - inode_init_once(&p->vfs_inode); 218 + inode_init_once(&p->vfs_inode); 220 219 } 221 220 222 221 static struct inode *mqueue_alloc_inode(struct super_block *sb)
+2 -4
kernel/fork.c
··· 1427 1427 { 1428 1428 struct sighand_struct *sighand = data; 1429 1429 1430 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 1431 - spin_lock_init(&sighand->siglock); 1432 - INIT_LIST_HEAD(&sighand->signalfd_list); 1433 - } 1430 + spin_lock_init(&sighand->siglock); 1431 + INIT_LIST_HEAD(&sighand->signalfd_list); 1434 1432 } 1435 1433 1436 1434 void __init proc_caches_init(void)
+3 -5
mm/rmap.c
··· 162 162 static void anon_vma_ctor(void *data, struct kmem_cache *cachep, 163 163 unsigned long flags) 164 164 { 165 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 166 - struct anon_vma *anon_vma = data; 165 + struct anon_vma *anon_vma = data; 167 166 168 - spin_lock_init(&anon_vma->lock); 169 - INIT_LIST_HEAD(&anon_vma->head); 170 - } 167 + spin_lock_init(&anon_vma->lock); 168 + INIT_LIST_HEAD(&anon_vma->head); 171 169 } 172 170 173 171 void __init anon_vma_init(void)
+3 -5
mm/shmem.c
··· 2358 2358 { 2359 2359 struct shmem_inode_info *p = (struct shmem_inode_info *) foo; 2360 2360 2361 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 2362 - inode_init_once(&p->vfs_inode); 2361 + inode_init_once(&p->vfs_inode); 2363 2362 #ifdef CONFIG_TMPFS_POSIX_ACL 2364 - p->i_acl = NULL; 2365 - p->i_default_acl = NULL; 2363 + p->i_acl = NULL; 2364 + p->i_default_acl = NULL; 2366 2365 #endif 2367 - } 2368 2366 } 2369 2367 2370 2368 static int init_inodecache(void)
+5 -7
mm/slab.c
··· 2610 2610 } 2611 2611 2612 2612 static void cache_init_objs(struct kmem_cache *cachep, 2613 - struct slab *slabp, unsigned long ctor_flags) 2613 + struct slab *slabp) 2614 2614 { 2615 2615 int i; 2616 2616 ··· 2634 2634 */ 2635 2635 if (cachep->ctor && !(cachep->flags & SLAB_POISON)) 2636 2636 cachep->ctor(objp + obj_offset(cachep), cachep, 2637 - ctor_flags); 2637 + 0); 2638 2638 2639 2639 if (cachep->flags & SLAB_RED_ZONE) { 2640 2640 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE) ··· 2650 2650 cachep->buffer_size / PAGE_SIZE, 0); 2651 2651 #else 2652 2652 if (cachep->ctor) 2653 - cachep->ctor(objp, cachep, ctor_flags); 2653 + cachep->ctor(objp, cachep, 0); 2654 2654 #endif 2655 2655 slab_bufctl(slabp)[i] = i + 1; 2656 2656 } ··· 2739 2739 struct slab *slabp; 2740 2740 size_t offset; 2741 2741 gfp_t local_flags; 2742 - unsigned long ctor_flags; 2743 2742 struct kmem_list3 *l3; 2744 2743 2745 2744 /* ··· 2747 2748 */ 2748 2749 BUG_ON(flags & ~(GFP_DMA | GFP_LEVEL_MASK)); 2749 2750 2750 - ctor_flags = SLAB_CTOR_CONSTRUCTOR; 2751 2751 local_flags = (flags & GFP_LEVEL_MASK); 2752 2752 /* Take the l3 list lock to change the colour_next on this node */ 2753 2753 check_irq_off(); ··· 2791 2793 slabp->nodeid = nodeid; 2792 2794 slab_map_pages(cachep, slabp, objp); 2793 2795 2794 - cache_init_objs(cachep, slabp, ctor_flags); 2796 + cache_init_objs(cachep, slabp); 2795 2797 2796 2798 if (local_flags & __GFP_WAIT) 2797 2799 local_irq_disable(); ··· 3075 3077 #endif 3076 3078 objp += obj_offset(cachep); 3077 3079 if (cachep->ctor && cachep->flags & SLAB_POISON) 3078 - cachep->ctor(objp, cachep, SLAB_CTOR_CONSTRUCTOR); 3080 + cachep->ctor(objp, cachep, 0); 3079 3081 #if ARCH_SLAB_MINALIGN 3080 3082 if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) { 3081 3083 printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
+1 -1
mm/slob.c
··· 327 327 b = (void *)__get_free_pages(flags, get_order(c->size)); 328 328 329 329 if (c->ctor) 330 - c->ctor(b, c, SLAB_CTOR_CONSTRUCTOR); 330 + c->ctor(b, c, 0); 331 331 332 332 return b; 333 333 }
+1 -1
mm/slub.c
··· 994 994 } 995 995 996 996 if (unlikely(s->ctor)) 997 - s->ctor(object, s, SLAB_CTOR_CONSTRUCTOR); 997 + s->ctor(object, s, 0); 998 998 } 999 999 1000 1000 static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
+1 -2
net/socket.c
··· 261 261 { 262 262 struct socket_alloc *ei = (struct socket_alloc *)foo; 263 263 264 - if (flags & SLAB_CTOR_CONSTRUCTOR) 265 - inode_init_once(&ei->vfs_inode); 264 + inode_init_once(&ei->vfs_inode); 266 265 } 267 266 268 267 static int init_inodecache(void)
+11 -13
net/sunrpc/rpc_pipe.c
··· 828 828 { 829 829 struct rpc_inode *rpci = (struct rpc_inode *) foo; 830 830 831 - if (flags & SLAB_CTOR_CONSTRUCTOR) { 832 - inode_init_once(&rpci->vfs_inode); 833 - rpci->private = NULL; 834 - rpci->nreaders = 0; 835 - rpci->nwriters = 0; 836 - INIT_LIST_HEAD(&rpci->in_upcall); 837 - INIT_LIST_HEAD(&rpci->pipe); 838 - rpci->pipelen = 0; 839 - init_waitqueue_head(&rpci->waitq); 840 - INIT_DELAYED_WORK(&rpci->queue_timeout, 841 - rpc_timeout_upcall_queue); 842 - rpci->ops = NULL; 843 - } 831 + inode_init_once(&rpci->vfs_inode); 832 + rpci->private = NULL; 833 + rpci->nreaders = 0; 834 + rpci->nwriters = 0; 835 + INIT_LIST_HEAD(&rpci->in_upcall); 836 + INIT_LIST_HEAD(&rpci->pipe); 837 + rpci->pipelen = 0; 838 + init_waitqueue_head(&rpci->waitq); 839 + INIT_DELAYED_WORK(&rpci->queue_timeout, 840 + rpc_timeout_upcall_queue); 841 + rpci->ops = NULL; 844 842 } 845 843 846 844 int register_rpc_pipefs(void)