diff mbox series

null_blk: Delete nullb.{queue_depth, nr_queues}

Message ID 20240222083420.6026-1-john.g.garry@oracle.com (mailing list archive)
State New, archived
Headers show
Series null_blk: Delete nullb.{queue_depth, nr_queues} | expand

Commit Message

John Garry Feb. 22, 2024, 8:34 a.m. UTC
Since commit 8b631f9cf0b8 ("null_blk: remove the bio based I/O path"),
struct nullb members queue_depth and nr_queues are only ever written, so
delete them.

With that, null_exit_hctx() can also be deleted.

Signed-off-by: John Garry <john.g.garry@oracle.com>

Comments

Jens Axboe Feb. 22, 2024, 5:09 p.m. UTC | #1
On Thu, 22 Feb 2024 08:34:20 +0000, John Garry wrote:
> Since commit 8b631f9cf0b8 ("null_blk: remove the bio based I/O path"),
> struct nullb members queue_depth and nr_queues are only ever written, so
> delete them.
> 
> With that, null_exit_hctx() can also be deleted.
> 
> 
> [...]

Applied, thanks!

[1/1] null_blk: Delete nullb.{queue_depth, nr_queues}
      commit: 0f225f87873ee95dd4cf94dfc6a3249d4289e4ea

Best regards,
Christoph Hellwig Feb. 23, 2024, 6:36 a.m. UTC | #2
Thanks,

this looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index a0b726c8366c..71c39bcd872c 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1620,14 +1620,6 @@  static void null_queue_rqs(struct request **rqlist)
 	*rqlist = requeue_list;
 }
 
-static void null_exit_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
-{
-	struct nullb_queue *nq = hctx->driver_data;
-	struct nullb *nullb = nq->dev->nullb;
-
-	nullb->nr_queues--;
-}
-
 static void null_init_queue(struct nullb *nullb, struct nullb_queue *nq)
 {
 	nq->dev = nullb->dev;
@@ -1647,7 +1639,6 @@  static int null_init_hctx(struct blk_mq_hw_ctx *hctx, void *driver_data,
 	nq = &nullb->queues[hctx_idx];
 	hctx->driver_data = nq;
 	null_init_queue(nullb, nq);
-	nullb->nr_queues++;
 
 	return 0;
 }
@@ -1660,7 +1651,6 @@  static const struct blk_mq_ops null_mq_ops = {
 	.poll		= null_poll,
 	.map_queues	= null_map_queues,
 	.init_hctx	= null_init_hctx,
-	.exit_hctx	= null_exit_hctx,
 };
 
 static void null_del_dev(struct nullb *nullb)
@@ -1731,7 +1721,6 @@  static int setup_queues(struct nullb *nullb)
 	if (!nullb->queues)
 		return -ENOMEM;
 
-	nullb->queue_depth = nullb->dev->hw_queue_depth;
 	return 0;
 }
 
diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h
index 25320fe34bfe..477b97746823 100644
--- a/drivers/block/null_blk/null_blk.h
+++ b/drivers/block/null_blk/null_blk.h
@@ -114,14 +114,12 @@  struct nullb {
 	struct gendisk *disk;
 	struct blk_mq_tag_set *tag_set;
 	struct blk_mq_tag_set __tag_set;
-	unsigned int queue_depth;
 	atomic_long_t cur_bytes;
 	struct hrtimer bw_timer;
 	unsigned long cache_flush_pos;
 	spinlock_t lock;
 
 	struct nullb_queue *queues;
-	unsigned int nr_queues;
 	char disk_name[DISK_NAME_LEN];
 };