linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ublk: remove unused req argument from ublk_sub_req_ref()
@ 2025-07-15 15:42 Caleb Sander Mateos
  2025-07-15 18:13 ` Jens Axboe
  2025-07-15 22:38 ` Ming Lei
  0 siblings, 2 replies; 3+ messages in thread
From: Caleb Sander Mateos @ 2025-07-15 15:42 UTC (permalink / raw)
  To: Ming Lei, Jens Axboe; +Cc: Caleb Sander Mateos, linux-block, linux-kernel

Since commit b749965edda8 ("ublk: remove ublk_commit_and_fetch()"),
ublk_sub_req_ref() no longer uses its struct request *req argument.
So drop the argument from ublk_sub_req_ref(), and from
ublk_need_complete_req(), which only passes it to ublk_sub_req_ref().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
---
 drivers/block/ublk_drv.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index d8b378ad6872..57e64c6b5549 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -712,11 +712,11 @@ static inline void ublk_put_req_ref(struct ublk_io *io, struct request *req)
 {
 	if (refcount_dec_and_test(&io->ref))
 		__ublk_complete_rq(req);
 }
 
-static inline bool ublk_sub_req_ref(struct ublk_io *io, struct request *req)
+static inline bool ublk_sub_req_ref(struct ublk_io *io)
 {
 	unsigned sub_refs = UBLK_REFCOUNT_INIT - io->task_registered_buffers;
 
 	io->task_registered_buffers = 0;
 	return refcount_sub_and_test(sub_refs, &io->ref);
@@ -2241,15 +2241,14 @@ static int ublk_check_commit_and_fetch(const struct ublk_queue *ubq,
 
 	return 0;
 }
 
 static bool ublk_need_complete_req(const struct ublk_queue *ubq,
-				   struct ublk_io *io,
-				   struct request *req)
+				   struct ublk_io *io)
 {
 	if (ublk_need_req_ref(ubq))
-		return ublk_sub_req_ref(io, req);
+		return ublk_sub_req_ref(io);
 	return true;
 }
 
 static bool ublk_get_data(const struct ublk_queue *ubq, struct ublk_io *io,
 			  struct request *req)
@@ -2357,11 +2356,11 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
 		if (ret)
 			goto out;
 		io->res = ub_cmd->result;
 		req = ublk_fill_io_cmd(io, cmd);
 		ret = ublk_config_io_buf(ubq, io, cmd, ub_cmd->addr, &buf_idx);
-		compl = ublk_need_complete_req(ubq, io, req);
+		compl = ublk_need_complete_req(ubq, io);
 
 		/* can't touch 'ublk_io' any more */
 		if (buf_idx != UBLK_INVALID_BUF_IDX)
 			io_buffer_unregister_bvec(cmd, buf_idx, issue_flags);
 		if (req_op(req) == REQ_OP_ZONE_APPEND)
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ublk: remove unused req argument from ublk_sub_req_ref()
  2025-07-15 15:42 [PATCH] ublk: remove unused req argument from ublk_sub_req_ref() Caleb Sander Mateos
@ 2025-07-15 18:13 ` Jens Axboe
  2025-07-15 22:38 ` Ming Lei
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2025-07-15 18:13 UTC (permalink / raw)
  To: Ming Lei, Caleb Sander Mateos; +Cc: linux-block, linux-kernel


On Tue, 15 Jul 2025 09:42:43 -0600, Caleb Sander Mateos wrote:
> Since commit b749965edda8 ("ublk: remove ublk_commit_and_fetch()"),
> ublk_sub_req_ref() no longer uses its struct request *req argument.
> So drop the argument from ublk_sub_req_ref(), and from
> ublk_need_complete_req(), which only passes it to ublk_sub_req_ref().
> 
> 

Applied, thanks!

[1/1] ublk: remove unused req argument from ublk_sub_req_ref()
      commit: 01ceec076ba10cb6c9f5642f996203170412cd78

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ublk: remove unused req argument from ublk_sub_req_ref()
  2025-07-15 15:42 [PATCH] ublk: remove unused req argument from ublk_sub_req_ref() Caleb Sander Mateos
  2025-07-15 18:13 ` Jens Axboe
@ 2025-07-15 22:38 ` Ming Lei
  1 sibling, 0 replies; 3+ messages in thread
From: Ming Lei @ 2025-07-15 22:38 UTC (permalink / raw)
  To: Caleb Sander Mateos; +Cc: Jens Axboe, linux-block, linux-kernel

On Tue, Jul 15, 2025 at 09:42:43AM -0600, Caleb Sander Mateos wrote:
> Since commit b749965edda8 ("ublk: remove ublk_commit_and_fetch()"),
> ublk_sub_req_ref() no longer uses its struct request *req argument.
> So drop the argument from ublk_sub_req_ref(), and from
> ublk_need_complete_req(), which only passes it to ublk_sub_req_ref().
> 
> Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>

Reviewed-by: Ming Lei <ming.lei@redhat.com>

Thanks, 
Ming


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-15 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 15:42 [PATCH] ublk: remove unused req argument from ublk_sub_req_ref() Caleb Sander Mateos
2025-07-15 18:13 ` Jens Axboe
2025-07-15 22:38 ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).