diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-08-26 15:44:33 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-08-27 10:14:17 -0700 |
commit | c2257df4108ed872f46c96d6ea6092f17a747632 (patch) | |
tree | 557ae85a96bf32ff8c56794ca623c7174b169181 /drivers/md/md-bitmap.c | |
parent | 2d3b130e177f14b461c47880b6e0b338fd6872f5 (diff) |
md/md-bitmap: merge md_bitmap_startwrite() 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 'behind' from int to bool.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-24-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md-bitmap.c')
-rw-r--r-- | drivers/md/md-bitmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 6448f78d50c2..0168dbd5ecb0 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -1458,8 +1458,11 @@ __acquires(bitmap->lock) &(bitmap->bp[page].map[pageoff]); } -int md_bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, int behind) +static int bitmap_startwrite(struct mddev *mddev, sector_t offset, + unsigned long sectors, bool behind) { + struct bitmap *bitmap = mddev->bitmap; + if (!bitmap) return 0; @@ -1520,7 +1523,6 @@ int md_bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long s } return 0; } -EXPORT_SYMBOL(md_bitmap_startwrite); void md_bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, int success, int behind) @@ -2728,6 +2730,8 @@ static struct bitmap_operations bitmap_ops = { .write_all = bitmap_write_all, .dirty_bits = bitmap_dirty_bits, + .startwrite = bitmap_startwrite, + .update_sb = bitmap_update_sb, .get_stats = bitmap_get_stats, }; |