Commit d43929ef authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Mikulas Patocka
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
parent 45fc7285
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -369,6 +369,21 @@ static int delay_map(struct dm_target *ti, struct bio *bio)
	return delay_bio(dc, c, bio);
}

#ifdef CONFIG_BLK_DEV_ZONED
static int delay_report_zones(struct dm_target *ti,
		struct dm_report_zones_args *args, unsigned int nr_zones)
{
	struct delay_c *dc = ti->private;
	struct delay_class *c = &dc->read;

	return dm_report_zones(c->dev->bdev, c->start,
			c->start + dm_target_offset(ti, args->next_sector),
			args, nr_zones);
}
#else
#define delay_report_zones	NULL
#endif

#define DMEMIT_DELAY_CLASS(c) \
	DMEMIT("%s %llu %u", (c)->dev->name, (unsigned long long)(c)->start, (c)->delay)

@@ -424,11 +439,12 @@ static int delay_iterate_devices(struct dm_target *ti,
static struct target_type delay_target = {
	.name	     = "delay",
	.version     = {1, 4, 0},
	.features    = DM_TARGET_PASSES_INTEGRITY,
	.features    = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_ZONED_HM,
	.module      = THIS_MODULE,
	.ctr	     = delay_ctr,
	.dtr	     = delay_dtr,
	.map	     = delay_map,
	.report_zones = delay_report_zones,
	.presuspend  = delay_presuspend,
	.resume	     = delay_resume,
	.status	     = delay_status,