aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-06-01 05:37:35 -0400
committerNeilBrown <neilb@suse.de>2010-07-25 23:21:34 -0400
commit69e51b449d383e97b1b9f890f8378c96e9e17346 (patch)
tree650123fa4f08e8fa7f348a4ca875c59c129e5d84 /drivers/md/md.c
parente384e58549a2e9a83071ad80280c1a9053cfd84c (diff)
md/bitmap: separate out loading a bitmap from initialising the structures.
dm makes this distinction between ->ctr and ->resume, so we need to too. Also get the new bitmap_load to clear out the bitmap first, as this is most consistent with the dm suspend/resume approach Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9d4e44e460e9..40b7ca0294ac 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4594,7 +4594,11 @@ static int do_md_run(mddev_t *mddev)
4594 err = md_run(mddev); 4594 err = md_run(mddev);
4595 if (err) 4595 if (err)
4596 goto out; 4596 goto out;
4597 4597 err = bitmap_load(mddev);
4598 if (err) {
4599 bitmap_destroy(mddev);
4600 goto out;
4601 }
4598 set_capacity(mddev->gendisk, mddev->array_sectors); 4602 set_capacity(mddev->gendisk, mddev->array_sectors);
4599 revalidate_disk(mddev->gendisk); 4603 revalidate_disk(mddev->gendisk);
4600 kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); 4604 kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
@@ -5382,8 +5386,11 @@ static int set_bitmap_file(mddev_t *mddev, int fd)
5382 err = 0; 5386 err = 0;
5383 if (mddev->pers) { 5387 if (mddev->pers) {
5384 mddev->pers->quiesce(mddev, 1); 5388 mddev->pers->quiesce(mddev, 1);
5385 if (fd >= 0) 5389 if (fd >= 0) {
5386 err = bitmap_create(mddev); 5390 err = bitmap_create(mddev);
5391 if (!err)
5392 err = bitmap_load(mddev);
5393 }
5387 if (fd < 0 || err) { 5394 if (fd < 0 || err) {
5388 bitmap_destroy(mddev); 5395 bitmap_destroy(mddev);
5389 fd = -1; /* make sure to put the file */ 5396 fd = -1; /* make sure to put the file */
@@ -5632,6 +5639,8 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info)
5632 mddev->bitmap_info.default_offset; 5639 mddev->bitmap_info.default_offset;
5633 mddev->pers->quiesce(mddev, 1); 5640 mddev->pers->quiesce(mddev, 1);
5634 rv = bitmap_create(mddev); 5641 rv = bitmap_create(mddev);
5642 if (!rv)
5643 rv = bitmap_load(mddev);
5635 if (rv) 5644 if (rv)
5636 bitmap_destroy(mddev); 5645 bitmap_destroy(mddev);
5637 mddev->pers->quiesce(mddev, 0); 5646 mddev->pers->quiesce(mddev, 0);