[Devel] [PATCH vz9 v1 08/63] dm-ploop: convert the rest of the lists to use llist variant
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Feb 4 19:41:14 MSK 2025
On 04.02.2025 07:39, Alexander Atanasov wrote:
> On 4.02.25 8:30, Pavel Tikhomirov wrote:
>>
>>
>> On 2/3/25 14:50, Alexander Atanasov wrote:
>>> On 31.01.25 10:32, Pavel Tikhomirov wrote:
>>>>
>>>>
>>>> On 1/24/25 23:35, Alexander Atanasov wrote:
>>>>> @@ -353,23 +352,20 @@ static void ploop_dispatch_pio(struct ploop
>>>>> *ploop, struct pio *pio,
>>>>> else
>>>>> *is_data = true;
>>>>> - list_add_tail(&pio->list, list);
>>>>> + llist_add((struct llist_node *)(&pio->list), list);
>>>>> }
>>>>
>>>> I still believe that proper enum should be added to pio structure, so
>>>> that we have separate pio->llist for llist operations and pio->list
>>>> for list operations.
>>>>
>>>
>>> i'd rather check if any list usages are left and change the type which
>>> was the initial goal.
>>
>> We definitely need to remove list field if it became unused. But we
>> should not have bad code (which tries to trick the compiler to believe
>> it uses proper type when it does not) while it is yet used.
>
>
> I mean pio->list is used but it is used only as llist , so type can be
> changed and casts removed. no need to use union.
>
>
>>
>>> The union /i beleive enum is a lapsus/ didn't worked due to static
>>> type checking in list macros.
>>
>> Sorry, I definitely meant s/enum/union/.
>>
>> You probably just did something wrong. To prove my point I wrote a
>> simple module which does what I'm talking about and works just fine:
>>
>> https://github.com/Snorch/list-union-module
>
> May be, i did.
>
>>
>> You should remove all improper "llist_add((struct llist_node *)" - like
>> uses and replace them with proper union uses.
>
> No, the goal is to only use llist , no need to use union. If there is a
> places left that use list as list.h and not llist.h /a quick grep shows
> there are none left/ they should be converted and type changed.
AFAIU we are going to keep this set of patches as is - all 63 patches, without merging them.
This means we will have those ugly (struct llist_node *) added and later removed when we don't have
"list" users.
If we were going to merge all the lists to llists conversion to a single patch, i would say - it's OK.
But as we keep the whole huge patchset for readability, i also don't like (struct llist_node *) back
and forth movements.
Please, rework the whole series to use the union {list, llist} and converted users are to just use
union->llist and that's it.
i will revert the whole previous series and apply the new one.
Thank you.
More information about the Devel
mailing list