Re: [PATCH] Assemble: check if device is container before scheduling force-clean update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 19 Mar 2022 23:12:36 +0800
Coly Li <colyli@xxxxxxx> wrote:

> Hi Kinga,
> 
> 
> I am fine with the above idea, except the extra is_container(). IMHO 
> comparing directly with LEVEL_CONTAINER is fine, adding
> is_container() doesn't help too much.
> 
> 

Hi Coly,

It is used in many places and is long. This is the main reason we
changed that. As you can see, some ifs was simplified and readability
is improved.
Generally, if something is repeated two or more times, it should be
gathered inside function. This simplifies future changes (for example
if we decide to add other level check here). Also it simplifies code
analysis (IDE will show us all usages) and it gives basic description.
In this case it could be redundant but IMO it is a design we should
follow.

We already proposed similar inline for raid456 in other patch.

Thanks,
Mariusz



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux