diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2011-03-17 06:11:05 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-17 06:11:05 -0400 |
commit | a91a2785b200864aef2270ed6a3babac7a253a20 (patch) | |
tree | 3d21d7ef82ddabbdbfb74499d68a73f15adc819f /drivers/md/md.c | |
parent | 82f04ab47e1d94d78503591a7460b2cad9601ede (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 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 86ba66c0b28a..1876761f1828 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1803,8 +1803,12 @@ int md_integrity_register(mddev_t *mddev) | |||
1803 | mdname(mddev)); | 1803 | mdname(mddev)); |
1804 | return -EINVAL; | 1804 | return -EINVAL; |
1805 | } | 1805 | } |
1806 | printk(KERN_NOTICE "md: data integrity on %s enabled\n", | 1806 | printk(KERN_NOTICE "md: data integrity enabled on %s\n", mdname(mddev)); |
1807 | mdname(mddev)); | 1807 | if (bioset_integrity_create(mddev->bio_set, BIO_POOL_SIZE)) { |
1808 | printk(KERN_ERR "md: failed to create integrity pool for %s\n", | ||
1809 | mdname(mddev)); | ||
1810 | return -EINVAL; | ||
1811 | } | ||
1808 | return 0; | 1812 | return 0; |
1809 | } | 1813 | } |
1810 | EXPORT_SYMBOL(md_integrity_register); | 1814 | EXPORT_SYMBOL(md_integrity_register); |