Skip to content

Commit d43929e

Browse files
Christoph HellwigMikulas Patocka
authored andcommitted
dm-delay: support zoned devices
Add support for zoned device by passing through report_zoned to the underlying read device. This is required to make enable xfstests xfs/311 on zoned devices. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent 45fc728 commit d43929e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/md/dm-delay.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,21 @@ static int delay_map(struct dm_target *ti, struct bio *bio)
369369
return delay_bio(dc, c, bio);
370370
}
371371

372+
#ifdef CONFIG_BLK_DEV_ZONED
373+
static int delay_report_zones(struct dm_target *ti,
374+
struct dm_report_zones_args *args, unsigned int nr_zones)
375+
{
376+
struct delay_c *dc = ti->private;
377+
struct delay_class *c = &dc->read;
378+
379+
return dm_report_zones(c->dev->bdev, c->start,
380+
c->start + dm_target_offset(ti, args->next_sector),
381+
args, nr_zones);
382+
}
383+
#else
384+
#define delay_report_zones NULL
385+
#endif
386+
372387
#define DMEMIT_DELAY_CLASS(c) \
373388
DMEMIT("%s %llu %u", (c)->dev->name, (unsigned long long)(c)->start, (c)->delay)
374389

@@ -424,11 +439,12 @@ static int delay_iterate_devices(struct dm_target *ti,
424439
static struct target_type delay_target = {
425440
.name = "delay",
426441
.version = {1, 4, 0},
427-
.features = DM_TARGET_PASSES_INTEGRITY,
442+
.features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_ZONED_HM,
428443
.module = THIS_MODULE,
429444
.ctr = delay_ctr,
430445
.dtr = delay_dtr,
431446
.map = delay_map,
447+
.report_zones = delay_report_zones,
432448
.presuspend = delay_presuspend,
433449
.resume = delay_resume,
434450
.status = delay_status,

0 commit comments

Comments
 (0)