From: Jens Axboe <axboe@kernel.dk>
To: Zhang Boyang <zhangboyang.id@gmail.com>,
Christoph Hellwig <hch@lst.de>,
linux-block@vger.kernel.org
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Jan Kara <jack@suse.cz>, Ming Lei <ming.lei@redhat.com>,
"Darrick J . Wong" <djwong@kernel.org>,
Chaitanya Kulkarni <kch@nvidia.com>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 1/1] loop: introduce LO_FLAGS_NODEALLOC
Date: Sat, 6 Aug 2022 08:51:52 -0600 [thread overview]
Message-ID: <026c2c04-aec2-0a8c-ed96-f31ae0918b2e@kernel.dk> (raw)
In-Reply-To: <20220806114943.8754-2-zhangboyang.id@gmail.com>
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
prev parent reply other threads:[~2022-08-06 14:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-06 11:49 [PATCH RESEND 0/1] loop: introduce LO_FLAGS_NODEALLOC Zhang Boyang
2022-08-06 11:49 ` [PATCH RESEND 1/1] " Zhang Boyang
2022-08-06 14:51 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=026c2c04-aec2-0a8c-ed96-f31ae0918b2e@kernel.dk \
--to=axboe@kernel.dk \
--cc=damien.lemoal@opensource.wdc.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=zhangboyang.id@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox