Skip to content

Commit d978006

Browse files
Christoph Hellwigaxboe
authored andcommitted
dm: move setting zoned_enabled to dm_table_set_restrictions
Keep it together with the rest of the zoned code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 80e4e17 commit d978006

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/md/dm-table.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,9 +2040,6 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
20402040
r = dm_set_zones_restrictions(t, q);
20412041
if (r)
20422042
return r;
2043-
if (blk_queue_is_zoned(q) &&
2044-
!static_key_enabled(&zoned_enabled.key))
2045-
static_branch_enable(&zoned_enabled);
20462043
}
20472044

20482045
dm_update_crypto_profile(q, t);

drivers/md/dm-zone.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,13 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q)
287287
queue_emulates_zone_append(q) ? "emulated" : "native");
288288
}
289289

290-
return dm_revalidate_zones(md, t);
290+
ret = dm_revalidate_zones(md, t);
291+
if (ret < 0)
292+
return ret;
293+
294+
if (!static_key_enabled(&zoned_enabled.key))
295+
static_branch_enable(&zoned_enabled);
296+
return 0;
291297
}
292298

293299
/*

0 commit comments

Comments
 (0)