[Devel] [RFC PATCH vz9 v6 10/62] dm-ploop: convert the rest of the lists to use llist variant

Alexander Atanasov alexander.atanasov at virtuozzo.com
Fri Jan 10 11:39:57 MSK 2025


On 10.01.25 10:23, Pavel Tikhomirov wrote:
> 
> 
> On 1/10/25 16:19, Alexander Atanasov wrote:
>> On 10.01.25 10:14, Pavel Tikhomirov wrote:
>>>
>>>
>>> On 12/6/24 05:55, Alexander Atanasov wrote:
>>>> @@ -1871,18 +1901,16 @@ static void ploop_submit_embedded_pio(struct 
>>>> ploop *ploop, struct pio *pio)
>>>>           worker = &ploop->fsync_worker;
>>>>       }
>>>> -    spin_lock_irqsave(&ploop->deferred_lock, flags);
>>>>       if (unlikely(ploop->stop_submitting_pios)) {
>>>>           llist_add((struct llist_node *)(&pio->list), &ploop- 
>>>> >llsuspended_pios);
>>>>           queue = false;
>>>> -        goto unlock;
>>>> +        goto out;
>>>
>>> Maybe just return here? We only set queue to false in this branch and 
>>> one more where we can just return instead, so we can, probably, also 
>>> remove queue variable in this patch.
>>
>> To have a single return point in the function, i see there is a return 
>> so may be i'll change it to a goto too.
> 
> That contradicts Linux Kernel codding style guide:
> 
>  > If there is no cleanup needed then just return directly.
> 
> https://www.kernel.org/doc/html/v4.10/process/coding-style.html#centralized-exiting-of-functions


Ok, it's better that way.

-- 
Regards,
Alexander Atanasov



More information about the Devel mailing list