[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f3141eb3-9938-a216-a9f8-cb193589a657@kernel.dk>
Date: Wed, 24 Feb 2021 09:48:21 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Stefan Hajnoczi <stefanha@...hat.com>,
Chaitanya Kulkarni <chaitanya.kulkarni@....com>
Cc: linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
linux-ide@...r.kernel.org, linux-mmc@...r.kernel.org,
target-devel@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-block@...r.kernel.org, dm-devel@...hat.com,
fujita.tomonori@....ntt.co.jp, tim@...erelk.net, mst@...hat.com,
jasowang@...hat.com, pbonzini@...hat.com, davem@...emloft.net,
bp@...en8.de, agk@...hat.com, snitzer@...hat.com,
ulf.hansson@...aro.org, jejb@...ux.ibm.com,
martin.petersen@...cle.com, dgilbert@...erlog.com,
Kai.Makisara@...umbus.fi, alim.akhtar@...sung.com,
avri.altman@....com, bfields@...ldses.org, chuck.lever@...cle.com,
baolin.wang@...aro.org, vbadigan@...eaurora.org, zliua@...ron.com,
richard.peng@...o.com, guoqing.jiang@...ud.ionos.com,
stanley.chu@...iatek.com, cang@...eaurora.org,
asutoshd@...eaurora.org, beanhuo@...ron.com, jaegeuk@...nel.org
Subject: Re: [RFC PATCH] blk-core: remove blk_put_request()
On 2/24/21 4:53 AM, Stefan Hajnoczi wrote:
> On Mon, Feb 22, 2021 at 01:11:15PM -0800, Chaitanya Kulkarni wrote:
>> The function blk_put_request() is just a wrapper to
>> blk_mq_free_request(), remove the unnecessary wrapper.
>>
>> Any feedback is welcome on this RFC.
>>
>> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
>> ---
>> block/blk-core.c | 6 ------
>> block/blk-merge.c | 2 +-
>> block/bsg-lib.c | 4 ++--
>> block/bsg.c | 4 ++--
>> block/scsi_ioctl.c | 6 +++---
>> drivers/block/paride/pd.c | 2 +-
>> drivers/block/pktcdvd.c | 2 +-
>> drivers/block/virtio_blk.c | 2 +-
>> drivers/cdrom/cdrom.c | 4 ++--
>> drivers/ide/ide-atapi.c | 2 +-
>> drivers/ide/ide-cd.c | 4 ++--
>> drivers/ide/ide-cd_ioctl.c | 2 +-
>> drivers/ide/ide-devsets.c | 2 +-
>> drivers/ide/ide-disk.c | 2 +-
>> drivers/ide/ide-ioctls.c | 4 ++--
>> drivers/ide/ide-park.c | 2 +-
>> drivers/ide/ide-pm.c | 4 ++--
>> drivers/ide/ide-tape.c | 2 +-
>> drivers/ide/ide-taskfile.c | 2 +-
>> drivers/md/dm-mpath.c | 2 +-
>> drivers/mmc/core/block.c | 10 +++++-----
>> drivers/scsi/scsi_error.c | 2 +-
>> drivers/scsi/scsi_lib.c | 2 +-
>> drivers/scsi/sg.c | 6 +++---
>> drivers/scsi/st.c | 4 ++--
>> drivers/scsi/ufs/ufshcd.c | 6 +++---
>> drivers/target/target_core_pscsi.c | 4 ++--
>> fs/nfsd/blocklayout.c | 4 ++--
>> include/linux/blkdev.h | 1 -
>> 29 files changed, 46 insertions(+), 53 deletions(-)
>>
>> diff --git a/block/blk-core.c b/block/blk-core.c
>> index fc60ff208497..1754f5e7cc80 100644
>> --- a/block/blk-core.c
>> +++ b/block/blk-core.c
>> @@ -642,12 +642,6 @@ struct request *blk_get_request(struct request_queue *q, unsigned int op,
>> }
>> EXPORT_SYMBOL(blk_get_request);
>>
>> -void blk_put_request(struct request *req)
>> -{
>> - blk_mq_free_request(req);
>> -}
>> -EXPORT_SYMBOL(blk_put_request);
>
> blk_get_request() still exists after this patch. A "get" API usually has
> a corresponding "put" API. I'm not sure this patch helps the consistency
> and clarity of the code.
>
> If you do go ahead, please update the blk_get_request() doc comment
> explicitly mentioning that blk_mq_free_request() needs to be called.
Would make sense to rename blk_get_request() to blk_mq_alloc_request()
and then we have API symmetry. The get/put don't make sense when there
are no references involved.
But it's a lot of churn for very little reward, which is always kind
of annoying. Especially for the person that has to carry the patches.
--
Jens Axboe
Powered by blists - more mailing lists