Commit 50953fe9e00ebbeffa032a565ab2f08312d51a87

Authored by Christoph Lameter
Committed by Linus Torvalds
1 parent 4b1d89290b

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 <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 55 changed files with 55 additions and 136 deletions Side-by-side Diff

arch/powerpc/platforms/cell/spufs/inode.c
... ... @@ -71,8 +71,7 @@
71 71 {
72 72 struct spufs_inode_info *ei = p;
73 73  
74   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
75   - SLAB_CTOR_CONSTRUCTOR) {
  74 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
76 75 inode_init_once(&ei->vfs_inode);
77 76 }
78 77 }
drivers/mtd/ubi/eba.c
... ... @@ -940,8 +940,7 @@
940 940 {
941 941 struct ltree_entry *le = obj;
942 942  
943   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) !=
944   - SLAB_CTOR_CONSTRUCTOR)
  943 + if (flags & SLAB_CTOR_CONSTRUCTOR)
945 944 return;
946 945  
947 946 le->users = 0;
... ... @@ -232,8 +232,7 @@
232 232 {
233 233 struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
234 234  
235   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
236   - SLAB_CTOR_CONSTRUCTOR)
  235 + if (flags & SLAB_CTOR_CONSTRUCTOR)
237 236 inode_init_once(&ei->vfs_inode);
238 237 }
239 238  
... ... @@ -87,8 +87,7 @@
87 87 {
88 88 struct affs_inode_info *ei = (struct affs_inode_info *) foo;
89 89  
90   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
91   - SLAB_CTOR_CONSTRUCTOR) {
  90 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
92 91 init_MUTEX(&ei->i_link_lock);
93 92 init_MUTEX(&ei->i_ext_lock);
94 93 inode_init_once(&ei->vfs_inode);
... ... @@ -453,8 +453,7 @@
453 453 {
454 454 struct afs_vnode *vnode = _vnode;
455 455  
456   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
457   - SLAB_CTOR_CONSTRUCTOR) {
  456 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
458 457 memset(vnode, 0, sizeof(*vnode));
459 458 inode_init_once(&vnode->vfs_inode);
460 459 init_waitqueue_head(&vnode->update_waitq);
... ... @@ -293,8 +293,7 @@
293 293 {
294 294 struct befs_inode_info *bi = (struct befs_inode_info *) foo;
295 295  
296   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
297   - SLAB_CTOR_CONSTRUCTOR) {
  296 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
298 297 inode_init_once(&bi->vfs_inode);
299 298 }
300 299 }
... ... @@ -248,8 +248,7 @@
248 248 {
249 249 struct bfs_inode_info *bi = foo;
250 250  
251   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
252   - SLAB_CTOR_CONSTRUCTOR)
  251 + if (flags & SLAB_CTOR_CONSTRUCTOR)
253 252 inode_init_once(&bi->vfs_inode);
254 253 }
255 254  
... ... @@ -457,9 +457,7 @@
457 457 struct bdev_inode *ei = (struct bdev_inode *) foo;
458 458 struct block_device *bdev = &ei->bdev;
459 459  
460   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
461   - SLAB_CTOR_CONSTRUCTOR)
462   - {
  460 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
463 461 memset(bdev, 0, sizeof(*bdev));
464 462 mutex_init(&bdev->bd_mutex);
465 463 sema_init(&bdev->bd_mount_sem, 1);
... ... @@ -2953,8 +2953,7 @@
2953 2953 static void
2954 2954 init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
2955 2955 {
2956   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
2957   - SLAB_CTOR_CONSTRUCTOR) {
  2956 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
2958 2957 struct buffer_head * bh = (struct buffer_head *)data;
2959 2958  
2960 2959 memset(bh, 0, sizeof(*bh));
... ... @@ -701,8 +701,7 @@
701 701 {
702 702 struct cifsInodeInfo *cifsi = inode;
703 703  
704   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
705   - SLAB_CTOR_CONSTRUCTOR) {
  704 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
706 705 inode_init_once(&cifsi->vfs_inode);
707 706 INIT_LIST_HEAD(&cifsi->lockList);
708 707 }
... ... @@ -62,8 +62,7 @@
62 62 {
63 63 struct coda_inode_info *ei = (struct coda_inode_info *) foo;
64 64  
65   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
66   - SLAB_CTOR_CONSTRUCTOR)
  65 + if (flags & SLAB_CTOR_CONSTRUCTOR)
67 66 inode_init_once(&ei->vfs_inode);
68 67 }
69 68  
... ... @@ -583,8 +583,7 @@
583 583 {
584 584 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
585 585  
586   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
587   - SLAB_CTOR_CONSTRUCTOR)
  586 + if (flags & SLAB_CTOR_CONSTRUCTOR)
588 587 inode_init_once(&ei->vfs_inode);
589 588 }
590 589  
... ... @@ -72,8 +72,7 @@
72 72 {
73 73 struct efs_inode_info *ei = (struct efs_inode_info *) foo;
74 74  
75   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
76   - SLAB_CTOR_CONSTRUCTOR)
  75 + if (flags & SLAB_CTOR_CONSTRUCTOR)
77 76 inode_init_once(&ei->vfs_inode);
78 77 }
79 78  
... ... @@ -160,8 +160,7 @@
160 160 {
161 161 struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
162 162  
163   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
164   - SLAB_CTOR_CONSTRUCTOR) {
  163 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
165 164 rwlock_init(&ei->i_meta_lock);
166 165 #ifdef CONFIG_EXT2_FS_XATTR
167 166 init_rwsem(&ei->xattr_sem);
... ... @@ -466,8 +466,7 @@
466 466 {
467 467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
468 468  
469   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
470   - SLAB_CTOR_CONSTRUCTOR) {
  469 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
471 470 INIT_LIST_HEAD(&ei->i_orphan);
472 471 #ifdef CONFIG_EXT3_FS_XATTR
473 472 init_rwsem(&ei->xattr_sem);
... ... @@ -517,8 +517,7 @@
517 517 {
518 518 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
519 519  
520   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
521   - SLAB_CTOR_CONSTRUCTOR) {
  520 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
522 521 INIT_LIST_HEAD(&ei->i_orphan);
523 522 #ifdef CONFIG_EXT4DEV_FS_XATTR
524 523 init_rwsem(&ei->xattr_sem);
... ... @@ -40,8 +40,7 @@
40 40 {
41 41 struct fat_cache *cache = (struct fat_cache *)foo;
42 42  
43   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
44   - SLAB_CTOR_CONSTRUCTOR)
  43 + if (flags & SLAB_CTOR_CONSTRUCTOR)
45 44 INIT_LIST_HEAD(&cache->cache_list);
46 45 }
47 46  
... ... @@ -499,8 +499,7 @@
499 499 {
500 500 struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
501 501  
502   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
503   - SLAB_CTOR_CONSTRUCTOR) {
  502 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
504 503 spin_lock_init(&ei->cache_lru_lock);
505 504 ei->nr_caches = 0;
506 505 ei->cache_valid_id = FAT_CACHE_VALID + 1;
... ... @@ -685,8 +685,7 @@
685 685 {
686 686 struct inode * inode = foo;
687 687  
688   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
689   - SLAB_CTOR_CONSTRUCTOR)
  688 + if (flags & SLAB_CTOR_CONSTRUCTOR)
690 689 inode_init_once(inode);
691 690 }
692 691  
... ... @@ -27,8 +27,7 @@
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_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
31   - SLAB_CTOR_CONSTRUCTOR) {
  30 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
32 31 inode_init_once(&ip->i_inode);
33 32 spin_lock_init(&ip->i_spin);
34 33 init_rwsem(&ip->i_rw_mutex);
... ... @@ -39,8 +38,7 @@
39 38 static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
40 39 {
41 40 struct gfs2_glock *gl = foo;
42   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
43   - SLAB_CTOR_CONSTRUCTOR) {
  41 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
44 42 INIT_HLIST_NODE(&gl->gl_list);
45 43 spin_lock_init(&gl->gl_spin);
46 44 INIT_LIST_HEAD(&gl->gl_holders);
... ... @@ -434,7 +434,7 @@
434 434 {
435 435 struct hfs_inode_info *i = p;
436 436  
437   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR)
  437 + if (flags & SLAB_CTOR_CONSTRUCTOR)
438 438 inode_init_once(&i->vfs_inode);
439 439 }
440 440  
... ... @@ -470,7 +470,7 @@
470 470 {
471 471 struct hfsplus_inode_info *i = p;
472 472  
473   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR)
  473 + if (flags & SLAB_CTOR_CONSTRUCTOR)
474 474 inode_init_once(&i->vfs_inode);
475 475 }
476 476  
... ... @@ -176,8 +176,7 @@
176 176 {
177 177 struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
178 178  
179   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
180   - SLAB_CTOR_CONSTRUCTOR) {
  179 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
181 180 mutex_init(&ei->i_mutex);
182 181 mutex_init(&ei->i_parent_mutex);
183 182 inode_init_once(&ei->vfs_inode);
fs/hugetlbfs/inode.c
... ... @@ -556,8 +556,7 @@
556 556 {
557 557 struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
558 558  
559   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
560   - SLAB_CTOR_CONSTRUCTOR)
  559 + if (flags & SLAB_CTOR_CONSTRUCTOR)
561 560 inode_init_once(&ei->vfs_inode);
562 561 }
563 562  
... ... @@ -213,8 +213,7 @@
213 213 {
214 214 struct inode * inode = (struct inode *) foo;
215 215  
216   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
217   - SLAB_CTOR_CONSTRUCTOR)
  216 + if (flags & SLAB_CTOR_CONSTRUCTOR)
218 217 inode_init_once(inode);
219 218 }
220 219  
... ... @@ -77,8 +77,7 @@
77 77 {
78 78 struct iso_inode_info *ei = foo;
79 79  
80   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
81   - SLAB_CTOR_CONSTRUCTOR)
  80 + if (flags & SLAB_CTOR_CONSTRUCTOR)
82 81 inode_init_once(&ei->vfs_inode);
83 82 }
84 83  
... ... @@ -47,8 +47,7 @@
47 47 {
48 48 struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
49 49  
50   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
51   - SLAB_CTOR_CONSTRUCTOR) {
  50 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
52 51 init_MUTEX(&ei->sem);
53 52 inode_init_once(&ei->vfs_inode);
54 53 }
fs/jfs/jfs_metapage.c
... ... @@ -184,8 +184,7 @@
184 184 {
185 185 struct metapage *mp = (struct metapage *)foo;
186 186  
187   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
188   - SLAB_CTOR_CONSTRUCTOR) {
  187 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
189 188 mp->lid = 0;
190 189 mp->lsn = 0;
191 190 mp->flag = 0;
... ... @@ -752,8 +752,7 @@
752 752 {
753 753 struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
754 754  
755   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
756   - SLAB_CTOR_CONSTRUCTOR) {
  755 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
757 756 memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
758 757 INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
759 758 init_rwsem(&jfs_ip->rdwrlock);
... ... @@ -203,8 +203,7 @@
203 203 {
204 204 struct file_lock *lock = (struct file_lock *) foo;
205 205  
206   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) !=
207   - SLAB_CTOR_CONSTRUCTOR)
  206 + if (!(flags & SLAB_CTOR_CONSTRUCTOR))
208 207 return;
209 208  
210 209 locks_init_lock(lock);
... ... @@ -73,8 +73,7 @@
73 73 {
74 74 struct minix_inode_info *ei = (struct minix_inode_info *) foo;
75 75  
76   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
77   - SLAB_CTOR_CONSTRUCTOR)
  76 + if (flags & SLAB_CTOR_CONSTRUCTOR)
78 77 inode_init_once(&ei->vfs_inode);
79 78 }
80 79  
... ... @@ -60,8 +60,7 @@
60 60 {
61 61 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
62 62  
63   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
64   - SLAB_CTOR_CONSTRUCTOR) {
  63 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
65 64 mutex_init(&ei->open_mutex);
66 65 inode_init_once(&ei->vfs_inode);
67 66 }
... ... @@ -1167,8 +1167,7 @@
1167 1167 {
1168 1168 struct nfs_inode *nfsi = (struct nfs_inode *) foo;
1169 1169  
1170   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
1171   - SLAB_CTOR_CONSTRUCTOR) {
  1170 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
1172 1171 inode_init_once(&nfsi->vfs_inode);
1173 1172 spin_lock_init(&nfsi->req_lock);
1174 1173 INIT_LIST_HEAD(&nfsi->dirty);
... ... @@ -3085,8 +3085,7 @@
3085 3085 {
3086 3086 ntfs_inode *ni = (ntfs_inode *)foo;
3087 3087  
3088   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
3089   - SLAB_CTOR_CONSTRUCTOR)
  3088 + if (flags & SLAB_CTOR_CONSTRUCTOR)
3090 3089 inode_init_once(VFS_I(ni));
3091 3090 }
3092 3091  
fs/ocfs2/dlm/dlmfs.c
... ... @@ -263,8 +263,7 @@
263 263 struct dlmfs_inode_private *ip =
264 264 (struct dlmfs_inode_private *) foo;
265 265  
266   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
267   - SLAB_CTOR_CONSTRUCTOR) {
  266 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
268 267 ip->ip_dlm = NULL;
269 268 ip->ip_parent = NULL;
270 269  
... ... @@ -937,8 +937,7 @@
937 937 {
938 938 struct ocfs2_inode_info *oi = data;
939 939  
940   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
941   - SLAB_CTOR_CONSTRUCTOR) {
  940 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
942 941 oi->ip_flags = 0;
943 942 oi->ip_open_count = 0;
944 943 spin_lock_init(&oi->ip_lock);
fs/openpromfs/inode.c
... ... @@ -419,8 +419,7 @@
419 419 {
420 420 struct op_inode_info *oi = (struct op_inode_info *) data;
421 421  
422   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
423   - SLAB_CTOR_CONSTRUCTOR)
  422 + if (flags & SLAB_CTOR_CONSTRUCTOR)
424 423 inode_init_once(&oi->vfs_inode);
425 424 }
426 425  
... ... @@ -109,8 +109,7 @@
109 109 {
110 110 struct proc_inode *ei = (struct proc_inode *) foo;
111 111  
112   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
113   - SLAB_CTOR_CONSTRUCTOR)
  112 + if (flags & SLAB_CTOR_CONSTRUCTOR)
114 113 inode_init_once(&ei->vfs_inode);
115 114 }
116 115  
... ... @@ -536,8 +536,7 @@
536 536 {
537 537 struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
538 538  
539   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
540   - SLAB_CTOR_CONSTRUCTOR)
  539 + if (flags & SLAB_CTOR_CONSTRUCTOR)
541 540 inode_init_once(&ei->vfs_inode);
542 541 }
543 542  
... ... @@ -511,8 +511,7 @@
511 511 {
512 512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
513 513  
514   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
515   - SLAB_CTOR_CONSTRUCTOR) {
  514 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
516 515 INIT_LIST_HEAD(&ei->i_prealloc_list);
517 516 inode_init_once(&ei->vfs_inode);
518 517 #ifdef CONFIG_REISERFS_FS_POSIX_ACL
... ... @@ -570,8 +570,7 @@
570 570 {
571 571 struct romfs_inode_info *ei = (struct romfs_inode_info *) foo;
572 572  
573   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
574   - SLAB_CTOR_CONSTRUCTOR)
  573 + if (flags & SLAB_CTOR_CONSTRUCTOR)
575 574 inode_init_once(&ei->vfs_inode);
576 575 }
577 576  
... ... @@ -69,9 +69,8 @@
69 69 static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
70 70 {
71 71 struct smb_inode_info *ei = (struct smb_inode_info *) foo;
72   - unsigned long flagmask = SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR;
73 72  
74   - if ((flags & flagmask) == SLAB_CTOR_CONSTRUCTOR)
  73 + if (flags & SLAB_CTOR_CONSTRUCTOR)
75 74 inode_init_once(&ei->vfs_inode);
76 75 }
77 76  
... ... @@ -322,8 +322,7 @@
322 322 {
323 323 struct sysv_inode_info *si = (struct sysv_inode_info *)p;
324 324  
325   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
326   - SLAB_CTOR_CONSTRUCTOR)
  325 + if (flags & SLAB_CTOR_CONSTRUCTOR)
327 326 inode_init_once(&si->vfs_inode);
328 327 }
329 328  
... ... @@ -134,9 +134,7 @@
134 134 {
135 135 struct udf_inode_info *ei = (struct udf_inode_info *) foo;
136 136  
137   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
138   - SLAB_CTOR_CONSTRUCTOR)
139   - {
  137 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
140 138 ei->i_ext.i_data = NULL;
141 139 inode_init_once(&ei->vfs_inode);
142 140 }
... ... @@ -1237,8 +1237,7 @@
1237 1237 {
1238 1238 struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
1239 1239  
1240   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
1241   - SLAB_CTOR_CONSTRUCTOR)
  1240 + if (flags & SLAB_CTOR_CONSTRUCTOR)
1242 1241 inode_init_once(&ei->vfs_inode);
1243 1242 }
1244 1243  
fs/xfs/linux-2.6/xfs_super.c
... ... @@ -360,8 +360,7 @@
360 360 kmem_zone_t *zonep,
361 361 unsigned long flags)
362 362 {
363   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
364   - SLAB_CTOR_CONSTRUCTOR)
  363 + if (flags & SLAB_CTOR_CONSTRUCTOR)
365 364 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
366 365 }
367 366  
include/linux/slab.h
... ... @@ -21,7 +21,6 @@
21 21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
22 22 */
23 23 #define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */
24   -#define SLAB_DEBUG_INITIAL 0x00000200UL /* DEBUG: Call constructor (as verifier) */
25 24 #define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */
26 25 #define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */
27 26 #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
... ... @@ -36,7 +35,6 @@
36 35 /* Flags passed to a constructor functions */
37 36 #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
38 37 #define SLAB_CTOR_ATOMIC 0x002UL /* Tell constructor it can't sleep */
39   -#define SLAB_CTOR_VERIFY 0x004UL /* Tell constructor it's a verify call */
40 38  
41 39 /*
42 40 * struct kmem_cache related prototypes
... ... @@ -215,8 +215,7 @@
215 215 {
216 216 struct mqueue_inode_info *p = (struct mqueue_inode_info *) foo;
217 217  
218   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
219   - SLAB_CTOR_CONSTRUCTOR)
  218 + if (flags & SLAB_CTOR_CONSTRUCTOR)
220 219 inode_init_once(&p->vfs_inode);
221 220 }
222 221  
... ... @@ -1425,8 +1425,7 @@
1425 1425 {
1426 1426 struct sighand_struct *sighand = data;
1427 1427  
1428   - if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
1429   - SLAB_CTOR_CONSTRUCTOR)
  1428 + if (flags & SLAB_CTOR_CONSTRUCTOR)
1430 1429 spin_lock_init(&sighand->siglock);
1431 1430 }
1432 1431  
... ... @@ -162,8 +162,7 @@
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_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
166   - SLAB_CTOR_CONSTRUCTOR) {
  165 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
167 166 struct anon_vma *anon_vma = data;
168 167  
169 168 spin_lock_init(&anon_vma->lock);
... ... @@ -2358,8 +2358,7 @@
2358 2358 {
2359 2359 struct shmem_inode_info *p = (struct shmem_inode_info *) foo;
2360 2360  
2361   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
2362   - SLAB_CTOR_CONSTRUCTOR) {
  2361 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
2363 2362 inode_init_once(&p->vfs_inode);
2364 2363 #ifdef CONFIG_TMPFS_POSIX_ACL
2365 2364 p->i_acl = NULL;
... ... @@ -116,8 +116,7 @@
116 116 #include <asm/page.h>
117 117  
118 118 /*
119   - * DEBUG - 1 for kmem_cache_create() to honour; SLAB_DEBUG_INITIAL,
120   - * SLAB_RED_ZONE & SLAB_POISON.
  119 + * DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON.
121 120 * 0 for faster, smaller code (especially in the critical paths).
122 121 *
123 122 * STATS - 1 to collect stats for /proc/slabinfo.
... ... @@ -172,7 +171,7 @@
172 171  
173 172 /* Legal flag mask for kmem_cache_create(). */
174 173 #if DEBUG
175   -# define CREATE_MASK (SLAB_DEBUG_INITIAL | SLAB_RED_ZONE | \
  174 +# define CREATE_MASK (SLAB_RED_ZONE | \
176 175 SLAB_POISON | SLAB_HWCACHE_ALIGN | \
177 176 SLAB_CACHE_DMA | \
178 177 SLAB_STORE_USER | \
... ... @@ -2184,12 +2183,6 @@
2184 2183  
2185 2184 #if DEBUG
2186 2185 WARN_ON(strchr(name, ' ')); /* It confuses parsers */
2187   - if ((flags & SLAB_DEBUG_INITIAL) && !ctor) {
2188   - /* No constructor, but inital state check requested */
2189   - printk(KERN_ERR "%s: No con, but init state check "
2190   - "requested - %s\n", __FUNCTION__, name);
2191   - flags &= ~SLAB_DEBUG_INITIAL;
2192   - }
2193 2186 #if FORCED_DEBUG
2194 2187 /*
2195 2188 * Enable redzoning and last user accounting, except for caches with
... ... @@ -2895,15 +2888,6 @@
2895 2888 BUG_ON(objnr >= cachep->num);
2896 2889 BUG_ON(objp != index_to_obj(cachep, slabp, objnr));
2897 2890  
2898   - if (cachep->flags & SLAB_DEBUG_INITIAL) {
2899   - /*
2900   - * Need to call the slab's constructor so the caller can
2901   - * perform a verify of its state (debugging). Called without
2902   - * the cache-lock held.
2903   - */
2904   - cachep->ctor(objp + obj_offset(cachep),
2905   - cachep, SLAB_CTOR_CONSTRUCTOR | SLAB_CTOR_VERIFY);
2906   - }
2907 2891 if (cachep->flags & SLAB_POISON && cachep->dtor) {
2908 2892 /* we want to cache poison the object,
2909 2893 * call the destruction callback
... ... @@ -97,9 +97,6 @@
97 97 *
98 98 * - Support PAGE_ALLOC_DEBUG. Should be easy to do.
99 99 *
100   - * - SLAB_DEBUG_INITIAL is not supported but I have never seen a use of
101   - * it.
102   - *
103 100 * - Variable sizing of the per node arrays
104 101 */
105 102  
... ... @@ -126,11 +123,6 @@
126 123 #endif
127 124  
128 125 /*
129   - * Flags from the regular SLAB that SLUB does not support:
130   - */
131   -#define SLUB_UNIMPLEMENTED (SLAB_DEBUG_INITIAL)
132   -
133   -/*
134 126 * Mininum number of partial slabs. These will be left on the partial
135 127 * lists even if they are empty. kmem_cache_shrink may reclaim them.
136 128 */
... ... @@ -1747,8 +1739,6 @@
1747 1739 s->objsize = size;
1748 1740 s->flags = flags;
1749 1741 s->align = align;
1750   -
1751   - BUG_ON(flags & SLUB_UNIMPLEMENTED);
1752 1742  
1753 1743 /*
1754 1744 * The page->offset field is only 16 bit wide. This is an offset
... ... @@ -261,8 +261,7 @@
261 261 {
262 262 struct socket_alloc *ei = (struct socket_alloc *)foo;
263 263  
264   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR))
265   - == SLAB_CTOR_CONSTRUCTOR)
  264 + if (flags & SLAB_CTOR_CONSTRUCTOR)
266 265 inode_init_once(&ei->vfs_inode);
267 266 }
268 267  
net/sunrpc/rpc_pipe.c
... ... @@ -828,8 +828,7 @@
828 828 {
829 829 struct rpc_inode *rpci = (struct rpc_inode *) foo;
830 830  
831   - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
832   - SLAB_CTOR_CONSTRUCTOR) {
  831 + if (flags & SLAB_CTOR_CONSTRUCTOR) {
833 832 inode_init_once(&rpci->vfs_inode);
834 833 rpci->private = NULL;
835 834 rpci->nreaders = 0;