From: Ruan Jinjie <ruanjinjie@huawei.com>
To: "Jens Axboe" <axboe@kernel.dk>,
linux-block@vger.kernel.org, drbd-dev@lists.linbit.com,
"Philipp Reisner" <philipp.reisner@linbit.com>,
"Lars Ellenberg" <lars.ellenberg@linbit.com>,
"Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
Subject: Re: [Drbd-dev] [PATCH -next] drbd: Use helper put_drbd_dev() and get_drbd_dev()
Date: Wed, 9 Aug 2023 09:32:08 +0800 [thread overview]
Message-ID: <ee32b802-91a8-f7a8-cf2a-e17de1aef9a9@huawei.com> (raw)
In-Reply-To: <5e560155-b2a4-e5bd-d22e-0e44a5a85f43@kernel.dk>
On 2023/8/9 1:36, Jens Axboe wrote:
> 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?
Sorry, I misunderstood the meaning of a helper.I'll learn more about
what other helper patches are doing. It's okay to keep it as it is.
>
prev parent reply other threads:[~2023-08-09 1:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 9:01 [Drbd-dev] [PATCH -next] drbd: Use helper put_drbd_dev() and get_drbd_dev() Ruan Jinjie
2023-08-08 17:36 ` Jens Axboe
2023-08-09 1:32 ` Ruan Jinjie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee32b802-91a8-f7a8-cf2a-e17de1aef9a9@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=axboe@kernel.dk \
--cc=christoph.boehmwalder@linbit.com \
--cc=drbd-dev@lists.linbit.com \
--cc=lars.ellenberg@linbit.com \
--cc=linux-block@vger.kernel.org \
--cc=philipp.reisner@linbit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox