[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7bfc4eb5-8f6f-663c-f1e2-faf6c1690866@huaweicloud.com>
Date: Mon, 12 May 2025 14:22:53 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Christoph Hellwig <hch@....de>, Yu Kuai <yukuai1@...weicloud.com>
Cc: xni@...hat.com, colyli@...nel.org, agk@...hat.com, snitzer@...nel.org,
mpatocka@...hat.com, song@...nel.org, linux-kernel@...r.kernel.org,
dm-devel@...ts.linux.dev, linux-raid@...r.kernel.org, yi.zhang@...wei.com,
yangerkun@...wei.com, johnny.chenyi@...wei.com,
"yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH RFC md-6.16 v3 02/19] md: support discard for bitmap ops
Hi,
在 2025/05/12 14:12, Christoph Hellwig 写道:
> On Mon, May 12, 2025 at 02:05:56PM +0800, Yu Kuai wrote:
>>>> - mddev->bitmap_ops->startwrite(mddev, md_io_clone->offset,
>>>> - md_io_clone->sectors);
>>>> + if (unlikely(md_io_clone->rw == STAT_DISCARD) &&
>>>> + mddev->bitmap_ops->start_discard)
>>>> + mddev->bitmap_ops->start_discard(mddev, md_io_clone->offset,
>>>> + md_io_clone->sectors);
>>>> + else
>>>> + mddev->bitmap_ops->startwrite(mddev, md_io_clone->offset,
>>>> + md_io_clone->sectors);
>>>> }
>>>
>>> This interface feels weird, as it would still call into the write
>>> interfaces when the discard ones are not defined instead of doing
>>> nothing. Also shouldn't discard also use a different interface
>>> than md_bitmap_start in the caller?
>>
>> This is because the old bitmap handle discard the same as write, I
>> can't do nothing in this case. Do you prefer also reuse the write
>> api to new discard api for old bitmap?
>
> It can just point the discard method to the same function as the
> existing write one.
Yes, this is exactly want I mean, I'll update this in the next version.
Thanks,
Kuai
>
> .
>
Powered by blists - more mailing lists