[Devel] [PATCH RH9 v2 3/8] dm/push_backup: add llseek_hole proxy

Alexander Atanasov alexander.atanasov at virtuozzo.com
Mon Aug 21 15:13:06 MSK 2023


On 16.08.23 12:32, 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.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..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;

Same as in prev in series - EINVAL vs EOPNOTSUP  usage ?

> +	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)

beside error value LGTM

-- 
Regards,
Alexander Atanasov



More information about the Devel mailing list