[Drbd-dev] [PATCH -next] drbd: Use helper put_drbd_dev() and get_drbd_dev()

Jens Axboe axboe at kernel.dk
Tue Aug 8 19:36:51 CEST 2023


On 8/8/23 3:01 AM, Ruan Jinjie wrote:
> The drbd_destroy_device() arg of this code is already duplicated
> 18 times, use helper function put_drbd_dev() to release drbd_device
> and related resources instead of open coding it to help improve
> code readability a bit.
> 
> And add get_drbd_dev() helper function to be symmetrical with it.
> 
> No functional change involved.

IMHO this just makes the code harder to read. You're not adding a
helper, all it does is call the same get/put parts. Why not just keep
it as-is then?

-- 
Jens Axboe




More information about the drbd-dev mailing list