[Devel] [PATCH RH9 3/7] dm/push_backup: add seek proxy

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Mon Jul 24 10:09:39 MSK 2023


Push backup dm module find_hole() should just call same function from
it's origin bdev

https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 drivers/md/dm-push-backup.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c
index 370bd23a70ff..a295f1b20ce9 100644
--- a/drivers/md/dm-push-backup.c
+++ b/drivers/md/dm-push-backup.c
@@ -754,6 +754,17 @@ static void pb_status(struct dm_target *ti, status_type_t type,
 	spin_unlock_irq(&pb->lock);
 }
 
+static loff_t pb_find_hole(struct dm_target *ti, loff_t offset,
+			      int whence)
+{
+	struct push_backup *pb = ti->private;
+	struct block_device *bdev = pb->origin_dev->bdev;
+
+	if (!bdev->bd_disk->fops->find_hole)
+		return -EINVAL;
+	return bdev->bd_disk->fops->find_hole(bdev, offset, whence);
+}
+
 static struct target_type pb_target = {
 	.name = "push_backup",
 	.version = {1, 0, 0},
@@ -766,6 +777,7 @@ static struct target_type pb_target = {
 	.message = pb_message,
 	.iterate_devices = pb_iterate_devices,
 	.status = pb_status,
+	.find_hole = pb_find_hole,
 };
 
 static int __init dm_pb_init(void)
-- 
2.39.3



More information about the Devel mailing list