Commit d9780064 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

dm: move setting zoned_enabled to dm_table_set_restrictions

Keep it together with the rest of the zoned code.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240527123634.1116952-2-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 80e4e17a
...@@ -2040,9 +2040,6 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, ...@@ -2040,9 +2040,6 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
r = dm_set_zones_restrictions(t, q); r = dm_set_zones_restrictions(t, q);
if (r) if (r)
return r; return r;
if (blk_queue_is_zoned(q) &&
!static_key_enabled(&zoned_enabled.key))
static_branch_enable(&zoned_enabled);
} }
dm_update_crypto_profile(q, t); dm_update_crypto_profile(q, t);
......
...@@ -287,7 +287,13 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q) ...@@ -287,7 +287,13 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q)
queue_emulates_zone_append(q) ? "emulated" : "native"); queue_emulates_zone_append(q) ? "emulated" : "native");
} }
return dm_revalidate_zones(md, t); ret = dm_revalidate_zones(md, t);
if (ret < 0)
return ret;
if (!static_key_enabled(&zoned_enabled.key))
static_branch_enable(&zoned_enabled);
return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment