[Devel] [PATCH RH9 v3 0/8] allow to seek holes in block devices

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Tue Sep 5 11:59:47 MSK 2023


We need to be able to know if and where the image is sparse during
backups.
Implement blockdev and dm infrastructure, add an ability to find
holes for dm-qcow2, dm-ploop, dm-push-backup
After this patches llseek with SEEK_HOLES and SEEK_DATA can be used
with block devices

Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop

v2:
 - s/find_hole/llseek_hole/
 - add new patch with calc_front_qio_bytes() helper
 - rework dm-qcow2 llseek_hole function

v3:
 - add new helper blkdev_llseek_wrapper() to cover common edge cases
 - rework calc_front_qio_bytes() to increase clarity

Andrey Zhadchenko (8):
  block/fops: add llseek_hole to blockdevops
  dm: add llseek_hole infrastructure
  dm/push_backup: add llseek_hole proxy
  dm/dm-qcow2: add calc_front_qio_bytes() helper
  dm/dm-qcow2: add llseek_hole
  dm/dm-ploop: reinforce some defines
  dm/dm-ploop: allow to check if cluster is locked
  dm/dm-ploop: add llseek_hole

 block/fops.c                  |  38 +++++
 drivers/md/dm-ploop-map.c     |  44 ++++-
 drivers/md/dm-ploop-target.c  |   1 +
 drivers/md/dm-ploop.h         |   9 +-
 drivers/md/dm-push-backup.c   |  12 ++
 drivers/md/dm-qcow2-map.c     | 297 ++++++++++++++++++++++++++++++++--
 drivers/md/dm-qcow2-target.c  |   1 +
 drivers/md/dm-qcow2.h         |   2 +
 drivers/md/dm.c               |  41 +++++
 include/linux/blkdev.h        |   1 +
 include/linux/device-mapper.h |   4 +
 11 files changed, 432 insertions(+), 18 deletions(-)

-- 
2.39.3



More information about the Devel mailing list