aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio.c
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2011-03-17 06:11:05 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-03-17 06:11:05 -0400
commita91a2785b200864aef2270ed6a3babac7a253a20 (patch)
tree3d21d7ef82ddabbdbfb74499d68a73f15adc819f /fs/bio.c
parent82f04ab47e1d94d78503591a7460b2cad9601ede (diff)
block: Require subsystems to explicitly allocate bio_set integrity mempool
MD and DM create a new bio_set for every metadevice. Each bio_set has an integrity mempool attached regardless of whether the metadevice is capable of passing integrity metadata. This is a waste of memory. Instead we defer the allocation decision to MD and DM since we know at metadevice creation time whether integrity passthrough is needed or not. Automatic integrity mempool allocation can then be removed from bioset_create() and we make an explicit integrity allocation for the fs_bio_set. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Acked-by: Mike Snitzer <snizer@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 5694b756ed01..85e2eabb1f81 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1636,9 +1636,6 @@ struct bio_set *bioset_create(unsigned int pool_size, unsigned int front_pad)
1636 if (!bs->bio_pool) 1636 if (!bs->bio_pool)
1637 goto bad; 1637 goto bad;
1638 1638
1639 if (bioset_integrity_create(bs, pool_size))
1640 goto bad;
1641
1642 if (!biovec_create_pools(bs, pool_size)) 1639 if (!biovec_create_pools(bs, pool_size))
1643 return bs; 1640 return bs;
1644 1641
@@ -1682,6 +1679,9 @@ static int __init init_bio(void)
1682 if (!fs_bio_set) 1679 if (!fs_bio_set)
1683 panic("bio: can't allocate bios\n"); 1680 panic("bio: can't allocate bios\n");
1684 1681
1682 if (bioset_integrity_create(fs_bio_set, BIO_POOL_SIZE))
1683 panic("bio: can't create integrity pool\n");
1684
1685 bio_split_pool = mempool_create_kmalloc_pool(BIO_SPLIT_ENTRIES, 1685 bio_split_pool = mempool_create_kmalloc_pool(BIO_SPLIT_ENTRIES,
1686 sizeof(struct bio_pair)); 1686 sizeof(struct bio_pair));
1687 if (!bio_split_pool) 1687 if (!bio_split_pool)