summaryrefslogtreecommitdiff
path: root/fs/bio.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-12-05 16:10:29 +0100
committerJens Axboe <jens.axboe@oracle.com>2009-03-24 12:35:16 +0100
commita7fcd37cdcb47806fb8a9070f006ee34061defa6 (patch)
tree3a983ae22551ce8d0aa062d84d8165df862811fa /fs/bio.c
parent34053979fb1d923217685cf166349f1899980581 (diff)
downloadlwn-a7fcd37cdcb47806fb8a9070f006ee34061defa6.tar.gz
lwn-a7fcd37cdcb47806fb8a9070f006ee34061defa6.zip
block: don't create bio_vec slabs of less than the inline number
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>
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bio.c b/fs/bio.c
index cef6258b8943..9cc1430b4495 100644
--- 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);