[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <026c2c04-aec2-0a8c-ed96-f31ae0918b2e@kernel.dk>
Date: Sat, 6 Aug 2022 08:51:52 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Zhang Boyang <zhangboyang.id@...il.com>,
Christoph Hellwig <hch@....de>, linux-block@...r.kernel.org
Cc: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Jan Kara <jack@...e.cz>, Ming Lei <ming.lei@...hat.com>,
"Darrick J . Wong" <djwong@...nel.org>,
Chaitanya Kulkarni <kch@...dia.com>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND 1/1] loop: introduce LO_FLAGS_NODEALLOC
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
Powered by blists - more mailing lists