Skip to content

loop: introduce LO_FLAGS_NO_DEALLOC

Zhang Boyang linux-block lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest1 patch 3 repliesIn review

Changes in v2 from the cover letter

Renamed NODEALLOC to NO_DEALLOC, to avoid confusion between NO_DEALLOC and NODE_ALLOC. Suggested by Jens Axboe.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1loop: introduce LO_FLAGS_NO_DEALLOCdrivers/block/loop.c include/uapi/linux/loop.h+26 -62 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/1] loop: introduce LO_FLAGS_NO_DEALLOC

Hi,

This patch gives userspace ability to prevent underlying file of loop device to be sparse. Currently, if loop device is 'trimmed' (BLKDISCARD), then underlying file will always become sparse and disk space freed. This behaviour is good for thin provisioning but not good for preallocated disk images. This patch introduces LO_FLAGS_NO_DEALLOC flag, which will write zeroes to underlying file instead of punching holes when BLKDISCARD is requested. Thus reducing file fragmentation of preallocated disk images and improve performance.

I will also submit patches to util-linux to provide userspace support if this patch is merged.

Changes in V1->V2:
Renamed NODEALLOC to NO_DEALLOC, to avoid confusion between NO_DEALLOC and NODE_ALLOC. Suggested by Jens Axboe.

Best Regards,
Zhang Boyang