diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-08-26 15:44:34 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-08-27 10:14:17 -0700 |
commit | 3486015facc030f30d694b92dc18e58073c6c9e0 (patch) | |
tree | 7fdaba0a9ec73e048f2ea73c8fa5eab22050c219 /drivers/md/raid5.c | |
parent | c2257df4108ed872f46c96d6ea6092f17a747632 (diff) | |
download | linux-3486015facc030f30d694b92dc18e58073c6c9e0.tar.gz linux-3486015facc030f30d694b92dc18e58073c6c9e0.tar.bz2 linux-3486015facc030f30d694b92dc18e58073c6c9e0.zip |
md/md-bitmap: merge md_bitmap_endwrite() into bitmap_operations
So that the implementation won't be exposed, and it'll be possible
to invent a new bitmap by replacing bitmap_operations.
Also change the parameter from bitmap to mddev, to avoid access
bitmap outside md-bitmap.c as much as possible. And change the type
of 'success' and 'behind' from int to bool.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-25-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c24036d1e6da..93d582b9f922 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3663,8 +3663,9 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, bi = nextbi; } if (bitmap_end) - md_bitmap_endwrite(conf->mddev->bitmap, sh->sector, - RAID5_STRIPE_SECTORS(conf), 0, 0); + conf->mddev->bitmap_ops->endwrite(conf->mddev, + sh->sector, RAID5_STRIPE_SECTORS(conf), + false, false); bitmap_end = 0; /* and fail all 'written' */ bi = sh->dev[i].written; @@ -3709,8 +3710,9 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, } } if (bitmap_end) - md_bitmap_endwrite(conf->mddev->bitmap, sh->sector, - RAID5_STRIPE_SECTORS(conf), 0, 0); + conf->mddev->bitmap_ops->endwrite(conf->mddev, + sh->sector, RAID5_STRIPE_SECTORS(conf), + false, false); /* If we were in the middle of a write the parity block might * still be locked - so just clear all R5_LOCKED flags */ @@ -4059,10 +4061,10 @@ returnbi: bio_endio(wbi); wbi = wbi2; } - md_bitmap_endwrite(conf->mddev->bitmap, sh->sector, - RAID5_STRIPE_SECTORS(conf), - !test_bit(STRIPE_DEGRADED, &sh->state), - 0); + conf->mddev->bitmap_ops->endwrite(conf->mddev, + sh->sector, RAID5_STRIPE_SECTORS(conf), + !test_bit(STRIPE_DEGRADED, &sh->state), + false); if (head_sh->batch_head) { sh = list_first_entry(&sh->batch_list, struct stripe_head, |