Re: [RFC PATCH v1 1/3] blk-cgroup: add helpers for bio cgroup state

"yu kuai" <yukuai-FxGnTmwa/[email protected]> Tue, 4 Aug 2026 23:07:03 +0800
Newsgroups gmane.linux.kernel.cgroups,gmane.linux.documentation,gmane.linux.kernel,gmane.linux.block,gmane.linux.kernel.bcache.devel,gmane.linux.raid,gmane.linux.file-systems,gmane.linux.kernel.mm
Message-ID <[email protected]>
Hi,

在 2026/8/4 21:25, Christoph Hellwig 写道:
> On Tue, Aug 04, 2026 at 12:52:16PM +0200, Jan Kara wrote:
>> Mostly looks good. Just I think bio_blkcg() should gracefully handle the
>> case where bio->bi_blkg is NULL (and return NULL in that case). That way
>> you can also get rid of somewhat odd pattern:
>>
>> 	if (!bio_blkg(bio))
>> 		return ...;
>> 	do something with bio_blkcg(bio)
>>
>> You can then just check bio_blkcg(bio) directly which is much more obvious.
> Yes.  Looking at the whole series I'm also not sure that this makes too
> much sense as a split out patch as the next one touches more than half
> of the callsite anyway.

Yes, this make sense, I'm trying not to cook a huge patch, but patch 2 is grow
much bigger than I was expected. Unless I figure out a nicer way to split patch 2,
I'll merge them in the next version.

>
-- 
Thanks,
Kuai