summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-02-13 08:34:18 +0100
committerJens Axboe <axboe@kernel.dk>2024-02-13 16:56:59 +0100
commitad751ba1f8d5d4f4f4b429b552a154e888524a93 (patch)
tree737da9e252e9636dd01a91be08241409b4971943 /block/genhd.c
parentblock: use queue_limits_commit_update in queue_discard_max_store (diff)
downloadlinux-ad751ba1f8d5d4f4f4b429b552a154e888524a93.tar.xz
linux-ad751ba1f8d5d4f4f4b429b552a154e888524a93.zip
block: pass a queue_limits argument to blk_alloc_queue
Pass a queue_limits to blk_alloc_queue and apply it after validating and capping the values using blk_validate_limits. This will allow allocating queues with valid queue limits instead of setting the values one at a time later. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20240213073425.1621680-9-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c
index d74fb5b4ae68..7a8fd57c51f7 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1393,11 +1393,12 @@ out_free_disk:
struct gendisk *__blk_alloc_disk(int node, struct lock_class_key *lkclass)
{
+ struct queue_limits lim = { };
struct request_queue *q;
struct gendisk *disk;
- q = blk_alloc_queue(node);
- if (!q)
+ q = blk_alloc_queue(&lim, node);
+ if (IS_ERR(q))
return NULL;
disk = __alloc_disk_node(q, node, lkclass);