[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <577a1bf6-9f23-0ccd-c269-d625ae11890d@huaweicloud.com>
Date: Mon, 26 May 2025 15:45:39 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Christoph Hellwig <hch@....de>, Yu Kuai <yukuai1@...weicloud.com>
Cc: xni@...hat.com, colyli@...nel.org, song@...nel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
johnny.chenyi@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH 06/23] md/md-bitmap: add a new sysfs api bitmap_type
Hi,
在 2025/05/26 14:32, Christoph Hellwig 写道:
> On Sat, May 24, 2025 at 02:13:03PM +0800, Yu Kuai wrote:
>> + consistency_policy
>
> .. these doc changes look unrelated, or am I missing something?
The position are moved to the front of the bitmap fields, because now
bitmap/xxx is not always here.
Before:
All md devices contain:
level
...
bitmap/xxx
bitmap/xxx
consistency_policy
uuid
After:
All md devices contain:
level
...
consistency_policy
uuid
bitmap_type
none xxx
bitmap xxx
If bitmap_type is bitmap, then the md device will also contain:
bitmap/xxx
bitmap/xxx
>
>> -static void mddev_set_bitmap_ops(struct mddev *mddev, enum md_submodule_id id)
>> +static bool mddev_set_bitmap_ops(struct mddev *mddev)
>> {
>> xa_lock(&md_submodule);
>> - mddev->bitmap_ops = xa_load(&md_submodule, id);
>> + mddev->bitmap_ops = xa_load(&md_submodule, mddev->bitmap_id);
>> xa_unlock(&md_submodule);
>> - if (!mddev->bitmap_ops)
>> - pr_warn_once("md: can't find bitmap id %d\n", id);
>> +
>> + if (!mddev->bitmap_ops) {
>> + pr_warn_once("md: can't find bitmap id %d\n", mddev->bitmap_id);
>> + return false;
>> + }
>> +
>> + return true;
>
> This also looks unrelated and like another prep patch?
The new api will set mddev->bitmap_id, and the above change switch to
use mddev->bitmap_id to register bitmap_ops, perhaps I can factor the
change to a new prep patch, like:
md: add a new field mddev->bitmap_id
Before:
mddev_set_bitmap_ops(mddev, ID_BITMAP);
After:
mddev->bitmap_id = ID_BITMAP;
if (!mddev_set_bitmap_ops(mddev))
return -EINVAL;
Thanks,
Kuai
>
> .
>
Powered by blists - more mailing lists