aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.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 /drivers/md/raid1.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 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c5
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 }
1137abort: 1137abort:
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
2024static int stop(mddev_t *mddev) 2023static int stop(mddev_t *mddev)