Commit ca925302 authored by Yu Kuai's avatar Yu Kuai Committed by Song Liu

md/md-bitmap: merge md_bitmap_flush() 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: default avatarYu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-17-yukuai1@huaweicloud.comSigned-off-by: default avatarSong Liu <song@kernel.org>
parent a2bd7031
...@@ -1773,10 +1773,7 @@ void md_bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long ...@@ -1773,10 +1773,7 @@ void md_bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long
} }
} }
/* static void bitmap_flush(struct mddev *mddev)
* flush out any pending updates
*/
void md_bitmap_flush(struct mddev *mddev)
{ {
struct bitmap *bitmap = mddev->bitmap; struct bitmap *bitmap = mddev->bitmap;
long sleep; long sleep;
...@@ -2725,6 +2722,7 @@ static struct bitmap_operations bitmap_ops = { ...@@ -2725,6 +2722,7 @@ static struct bitmap_operations bitmap_ops = {
.create = bitmap_create, .create = bitmap_create,
.load = bitmap_load, .load = bitmap_load,
.destroy = bitmap_destroy, .destroy = bitmap_destroy,
.flush = bitmap_flush,
}; };
void mddev_set_bitmap_ops(struct mddev *mddev) void mddev_set_bitmap_ops(struct mddev *mddev)
......
...@@ -250,13 +250,13 @@ struct bitmap_operations { ...@@ -250,13 +250,13 @@ struct bitmap_operations {
int (*create)(struct mddev *mddev, int slot); int (*create)(struct mddev *mddev, int slot);
int (*load)(struct mddev *mddev); int (*load)(struct mddev *mddev);
void (*destroy)(struct mddev *mddev); void (*destroy)(struct mddev *mddev);
void (*flush)(struct mddev *mddev);
}; };
/* the bitmap API */ /* the bitmap API */
void mddev_set_bitmap_ops(struct mddev *mddev); void mddev_set_bitmap_ops(struct mddev *mddev);
/* these are used only by md/bitmap */ /* these are used only by md/bitmap */
void md_bitmap_flush(struct mddev *mddev);
void md_bitmap_print_sb(struct bitmap *bitmap); void md_bitmap_print_sb(struct bitmap *bitmap);
void md_bitmap_update_sb(struct bitmap *bitmap); void md_bitmap_update_sb(struct bitmap *bitmap);
......
...@@ -6463,7 +6463,8 @@ static void __md_stop_writes(struct mddev *mddev) ...@@ -6463,7 +6463,8 @@ static void __md_stop_writes(struct mddev *mddev)
mddev->pers->quiesce(mddev, 1); mddev->pers->quiesce(mddev, 1);
mddev->pers->quiesce(mddev, 0); mddev->pers->quiesce(mddev, 0);
} }
md_bitmap_flush(mddev);
mddev->bitmap_ops->flush(mddev);
if (md_is_rdwr(mddev) && if (md_is_rdwr(mddev) &&
((!mddev->in_sync && !mddev_is_clustered(mddev)) || ((!mddev->in_sync && !mddev_is_clustered(mddev)) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment