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/raid1.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/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 8f34ad5c478b..c2a21ae56d97 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1132,7 +1132,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number) | |||
1132 | p->rdev = rdev; | 1132 | p->rdev = rdev; |
1133 | goto abort; | 1133 | goto abort; |
1134 | } | 1134 | } |
1135 | md_integrity_register(mddev); | 1135 | err = md_integrity_register(mddev); |
1136 | } | 1136 | } |
1137 | abort: | 1137 | abort: |
1138 | 1138 | ||
@@ -2017,8 +2017,7 @@ static int run(mddev_t *mddev) | |||
2017 | 2017 | ||
2018 | mddev->queue->backing_dev_info.congested_fn = raid1_congested; | 2018 | mddev->queue->backing_dev_info.congested_fn = raid1_congested; |
2019 | mddev->queue->backing_dev_info.congested_data = mddev; | 2019 | mddev->queue->backing_dev_info.congested_data = mddev; |
2020 | md_integrity_register(mddev); | 2020 | return md_integrity_register(mddev); |
2021 | return 0; | ||
2022 | } | 2021 | } |
2023 | 2022 | ||
2024 | static int stop(mddev_t *mddev) | 2023 | static int stop(mddev_t *mddev) |