diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-08-26 15:44:20 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-08-27 10:14:15 -0700 |
commit | 27832ad3f7f0f5080d472fa8621ff92166ca9fac (patch) | |
tree | 868e73a7f4737c8b449b26f624e83c3980e994ef /drivers/md/md-cluster.c | |
parent | 9e4481ce0e55b4ef9795845d8b6770e3f6f4b24d (diff) | |
download | lwn-27832ad3f7f0f5080d472fa8621ff92166ca9fac.tar.gz lwn-27832ad3f7f0f5080d472fa8621ff92166ca9fac.zip |
md/md-bitmap: add a new helper md_bitmap_set_pages()
Currently md-cluster will set bitmap->counts.pages directly, add a
helper to do this to avoid dereferencing bitmap directly.
Noted that after this patch bitmap is not dereferenced directly anymore
and following patches will move the structure inside md-bitmap.c.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-11-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md-cluster.c')
-rw-r--r-- | drivers/md/md-cluster.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index 76febdc5d7f6..59f7fbca783b 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -1163,7 +1163,6 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz for (i = 0; i < mddev->bitmap_info.nodes; i++) { struct dlm_lock_resource *bm_lockres; - struct bitmap_counts *counts; char str[64]; if (i == md_cluster_ops->slot_number(mddev)) @@ -1175,7 +1174,6 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz bitmap = NULL; goto out; } - counts = &bitmap->counts; rv = md_bitmap_get_stats(bitmap, &stats); if (rv) @@ -1193,7 +1191,7 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz bm_lockres->flags |= DLM_LKF_NOQUEUE; rv = dlm_lock_sync(bm_lockres, DLM_LOCK_PW); if (!rv) - counts->pages = my_pages; + md_bitmap_set_pages(bitmap, my_pages); lockres_free(bm_lockres); if (my_pages != stats.pages) |