diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-08-26 09:44:34 +0200 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-08-27 19:14:17 +0200 |
commit | 3486015facc030f30d694b92dc18e58073c6c9e0 (patch) | |
tree | 7fdaba0a9ec73e048f2ea73c8fa5eab22050c219 /drivers/md/raid1.c | |
parent | md/md-bitmap: merge md_bitmap_startwrite() into bitmap_operations (diff) | |
download | linux-3486015facc030f30d694b92dc18e58073c6c9e0.tar.xz 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/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 708687cb28d5..b335293ec472 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -411,18 +411,20 @@ static void raid1_end_read_request(struct bio *bio) static void close_write(struct r1bio *r1_bio) { + struct mddev *mddev = r1_bio->mddev; + /* it really is the end of this request */ if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { bio_free_pages(r1_bio->behind_master_bio); bio_put(r1_bio->behind_master_bio); r1_bio->behind_master_bio = NULL; } + /* clear the bitmap if all writes complete successfully */ - md_bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector, - r1_bio->sectors, - !test_bit(R1BIO_Degraded, &r1_bio->state), - test_bit(R1BIO_BehindIO, &r1_bio->state)); - md_write_end(r1_bio->mddev); + mddev->bitmap_ops->endwrite(mddev, r1_bio->sector, r1_bio->sectors, + !test_bit(R1BIO_Degraded, &r1_bio->state), + test_bit(R1BIO_BehindIO, &r1_bio->state)); + md_write_end(mddev); } static void r1_bio_write_done(struct r1bio *r1_bio) |