md/md-bitmap: merge md_bitmap_create() 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.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-14-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
This commit is contained in:
Yu Kuai
2024-08-26 15:44:23 +08:00
committed by Song Liu
parent 7545d385ec
commit 04c80e6495
3 changed files with 7 additions and 6 deletions

View File

@@ -6224,7 +6224,7 @@ int md_run(struct mddev *mddev)
}
if (err == 0 && pers->sync_request &&
(mddev->bitmap_info.file || mddev->bitmap_info.offset)) {
err = md_bitmap_create(mddev, -1);
err = mddev->bitmap_ops->create(mddev, -1);
if (err)
pr_warn("%s: failed to create bitmap (%d)\n",
mdname(mddev), err);
@@ -7282,7 +7282,7 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
err = 0;
if (mddev->pers) {
if (fd >= 0) {
err = md_bitmap_create(mddev, -1);
err = mddev->bitmap_ops->create(mddev, -1);
if (!err)
err = md_bitmap_load(mddev);
@@ -7576,7 +7576,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
mddev->bitmap_info.default_offset;
mddev->bitmap_info.space =
mddev->bitmap_info.default_space;
rv = md_bitmap_create(mddev, -1);
rv = mddev->bitmap_ops->create(mddev, -1);
if (!rv)
rv = md_bitmap_load(mddev);