On 5.09.23 11:59, Andrey Zhadchenko wrote:
push_backup dm module llseek_hole() should just call the same function
from it's origin bdev

Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko <andrey.zhadche...@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..42c880bcfb2c 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_llseek_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->llseek_hole)
+               return -EINVAL;
+       return bdev->bd_disk->fops->llseek_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,
+       .llseek_hole = pb_llseek_hole,
  };
static int __init dm_pb_init(void)


LGTM

--
Regards,
Alexander Atanasov

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to