summaryrefslogtreecommitdiff
path: root/drivers/md/dm-zone.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-05-27 14:36:20 +0200
committerJens Axboe <axboe@kernel.dk>2024-05-27 09:16:39 -0600
commitc8c1f7012b807ca4da0136eacab96961b56f25d5 (patch)
treefcd761caea1cb4f9560dea53799287cc3f939f82 /drivers/md/dm-zone.c
parent5e7a4bbcc33d7df6bcc8565a8938c196285e5423 (diff)
downloadlwn-c8c1f7012b807ca4da0136eacab96961b56f25d5.tar.gz
lwn-c8c1f7012b807ca4da0136eacab96961b56f25d5.zip
dm: make dm_set_zones_restrictions work on the queue limits
Don't stuff the values directly into the queue without any synchronization, but instead delay applying the queue limits in the caller and let dm_set_zones_restrictions work on the limit structure. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20240527123634.1116952-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-zone.c')
-rw-r--r--drivers/md/dm-zone.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/dm-zone.c b/drivers/md/dm-zone.c
index 0ee22494857d..5d66d916730e 100644
--- a/drivers/md/dm-zone.c
+++ b/drivers/md/dm-zone.c
@@ -220,7 +220,8 @@ static bool dm_table_supports_zone_append(struct dm_table *t)
return true;
}
-int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q)
+int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q,
+ struct queue_limits *lim)
{
struct mapped_device *md = t->md;
struct gendisk *disk = md->disk;
@@ -236,7 +237,7 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q)
clear_bit(DMF_EMULATE_ZONE_APPEND, &md->flags);
} else {
set_bit(DMF_EMULATE_ZONE_APPEND, &md->flags);
- blk_queue_max_zone_append_sectors(q, 0);
+ lim->max_zone_append_sectors = 0;
}
if (!get_capacity(md->disk))
@@ -260,9 +261,9 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q)
* a regular device.
*/
if (nr_conv_zones >= ret) {
- disk->queue->limits.max_open_zones = 0;
- disk->queue->limits.max_active_zones = 0;
- disk->queue->limits.zoned = false;
+ lim->max_open_zones = 0;
+ lim->max_active_zones = 0;
+ lim->zoned = false;
clear_bit(DMF_EMULATE_ZONE_APPEND, &md->flags);
disk->nr_zones = 0;
return 0;