[Devel] [PATCH vz9 v1 08/63] dm-ploop: convert the rest of the lists to use llist variant
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Tue Feb 4 09:30:01 MSK 2025
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.
> 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
You should remove all improper "llist_add((struct llist_node *)" - like
uses and replace them with proper union uses.
--
Best regards, Tikhomirov Pavel
Senior Software Developer, Virtuozzo.
More information about the Devel
mailing list