lkml.org 
[lkml]   [2022]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH RESEND 1/1] loop: introduce LO_FLAGS_NODEALLOC
From
On 8/6/22 5:49 AM, Zhang Boyang wrote:
> Previously, for file-backed loop devices, REQ_OP_DISCARD and
> REQ_OP_WRITE_ZEROES (without REQ_NOUNMAP) are implemented using
> fallocate(FALLOC_FL_PUNCH_HOLE), which will cause the underlying file to
> be sparse and disk space freed. The users have no choice to prevent this
> this from happening.
>
> This patch introduces LO_FLAGS_NODEALLOC. With this flag set,
> REQ_OP_DISCARD and REQ_OP_WRITE_ZEROES are forced to use
> fallocate(FALLOC_FL_ZERO_RANGE). The disk space of underlying file is
> kept allocated. This is useful if users, for example, want to use a
> preallocated file as the backing file.

Just in terms of readability, I would prefer if NO_DEALLOC is used
consistently rather than NODEALLOC. The latter reads more like
node-alloc to me.

--
Jens Axboe

\
 
 \ /
  Last update: 2022-08-06 16:52    [W:1.629 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site