All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm-delay: support zoned devices
@ 2025-03-21  7:18 Christoph Hellwig
  2025-03-21 17:52 ` Benjamin Marzinski
  2025-03-24 11:09 ` Damien Le Moal
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Hellwig @ 2025-03-21  7:18 UTC (permalink / raw)
  To: snitzer, mpatocka; +Cc: dm-devel

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>
---
 drivers/md/dm-delay.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index 08f6387620c1..d4cf0ac2a7aa 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -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,
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-03-26 16:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21  7:18 [PATCH] dm-delay: support zoned devices Christoph Hellwig
2025-03-21 17:52 ` Benjamin Marzinski
2025-03-23  6:28   ` Christoph Hellwig
2025-03-26 12:55   ` Damien Le Moal
2025-03-26 15:00     ` Benjamin Marzinski
2025-03-26 15:17       ` Damien Le Moal
2025-03-26 16:57         ` Benjamin Marzinski
2025-03-24 11:09 ` Damien Le Moal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.