Re: [PATCH RFC -next v2 05/41] md/md-bitmap: add 'sync_size' into struct md_bitmap_stats

Mariusz Tkaczyk
2024-08-14T12:53:02Z

On Wed, 14 Aug 2024 15:10:37 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:

> From: Yu Kuai <yukuai3@huawei.com>
>
> To avoid dereferencing bitmap directly in md-cluster to prepare
> inventing a new bitmap.
>
> BTW, also fix following checkpatch warnings:
>
> WARNING: Deprecated use of 'kmap_atomic', prefer 'kmap_local_page' instead
> WARNING: Deprecated use of 'kunmap_atomic', prefer 'kunmap_local' instead
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
> drivers/md/md-bitmap.c | 6 ++++++
> drivers/md/md-bitmap.h | 1 +
> drivers/md/md-cluster.c | 25 +++++++++++++++----------
> 3 files changed, 22 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index 8a2411040d2f..9ff5ed250ba5 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -2096,11 +2096,16 @@ EXPORT_SYMBOL_GPL(md_bitmap_copy_from_slot);
>
> int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
> {
> + bitmap_super_t *sb;
> struct bitmap_counts *counts;

Hi Kuai,

Use reversed christmas tree convention if possible :)

> diff --git a/drivers/md/md-bitmap.h b/drivers/md/md-bitmap.h
> index c8527ba38dfc..1a7ad2cf9f75 100644
> --- a/drivers/md/md-bitmap.h
> +++ b/drivers/md/md-bitmap.h
> @@ -237,6 +237,7 @@ struct bitmap {
> struct md_bitmap_stats {
> unsigned long pages;
> unsigned long missing_pages;
> + unsigned long sync_size;

Same here.

Anyway, LGTM.
Mariusz