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 SE
Implement find_hole() for dm-ploop target.
Iterate over clusters until we find hole or data by using
ploop_bat_entries() which will do all our work
Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko
---
drivers/md
Add new function to target_type, so any dm devices may realize it
Implement intermediate llseek_hole() on device-mapper layer, do some simple
checks.
Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko
---
v2: fix
Implement llseek_hole() for dm-qcow2 target.
Iterate over ranges with cluster granularity until hole or data is found.
To reduce code duplication, we should use already existing parse_metadata()
We can pretend that seek request is read request for metadata purposes
and than interpret parsing result
Add braces around arguments so callers can use equations while
calling these macros.
Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko
---
drivers/md/dm-ploop.h | 8
1 file changed, 4 insertions(+), 4 de
When looking for SEEK_HOLE, we would like to check if cluster is locked
without valid pio
Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko
---
drivers/md/dm-ploop-map.c | 2 +-
1 file changed, 1 insertion(+), 1
Move code that calculates qio front bytes type and amount into a new
helper. It will be used later for llseek_hole()
Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko
---
drivers/md/dm-qcow2-map.c | 46 ++
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
---
drivers/md/dm-push-backup.c | 12
1 file changed, 12
Add new function for block_device_operations, which will be used
for SEEK_HOLE and SEEK_DATA llseek calls
Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop
https://jira.vzint.dev/browse/PSBM-145746
Signed-off-by: Andrey Zhadchenko
---
v2: fix critical bug: do not (SEEK_HOLE | SEEK_DATA)