block: don't create bio_vec slabs of less than the inline number
authorJens Axboe <jens.axboe@oracle.com>
Fri, 5 Dec 2008 15:10:29 +0000 (16:10 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 24 Mar 2009 11:35:16 +0000 (12:35 +0100)
If we don't have CONFIG_BLK_DEV_INTEGRITY set, then we don't have
any external dependencies on the bio_vec slabs. So don't create
the ones that we will inline anyway.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/bio.c

index cef6258..9cc1430 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1589,6 +1589,13 @@ static void __init biovec_init_slabs(void)
                int size;
                struct biovec_slab *bvs = bvec_slabs + i;
 
+#ifndef CONFIG_BLK_DEV_INTEGRITY
+               if (bvs->nr_vecs <= BIO_INLINE_VECS) {
+                       bvs->slab = NULL;
+                       continue;
+               }
+#endif
+
                size = bvs->nr_vecs * sizeof(struct bio_vec);
                bvs->slab = kmem_cache_create(bvs->name, size, 0,
                                 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);