[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1C33DEE4-8BE9-4BF3-A589-E11532382B36@dilger.ca>
Date: Tue, 12 Jan 2021 11:51:07 -0700
From: Andreas Dilger <adilger@...ger.ca>
To: Christoph Hellwig <hch@...radead.org>
Cc: Avi Kivity <avi@...lladb.com>, Andres Freund <andres@...razel.de>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
linux-fsdevel@...r.kernel.org, linux-xfs@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: fallocate(FALLOC_FL_ZERO_RANGE_BUT_REALLY) to avoid unwritten
extents?
On Jan 12, 2021, at 11:43 AM, Christoph Hellwig <hch@...radead.org> wrote:
>
> On Tue, Jan 12, 2021 at 11:39:58AM -0700, Andreas Dilger wrote:
>>> XFS already has a XFS_IOC_ALLOCSP64 that is defined to actually
>>> allocate written extents. It does not currently use
>>> blkdev_issue_zeroout, but could be changed pretty trivially to do so.
>>>
>>>> But note it will need to be plumbed down to md and dm to be generally
>>>> useful.
>>>
>>> DM and MD already support mddev_check_write_zeroes, at least for the
>>> usual targets.
>>
>> Similarly, ext4 also has EXT4_GET_BLOCKS_CREATE_ZERO that can allocate zero
>> filled extents rather than unwritten extents (without clobbering existing
>> data like FALLOC_FL_ZERO_RANGE does), and just needs a flag from fallocate()
>> to trigger it. This is plumbed down to blkdev_issue_zeroout() as well.
>
> XFS_IOC_ALLOCSP64 actually is an ioctl that has been around since 1995
> on IRIX (as an fcntl).
I'm not against adding XFS_IOC_ALLOCSP64 to ext4, if applications are actually
using that.
It also makes sense to me that there also be an fallocate() mode for allocating
zeroed blocks (which was the original request), since fallocate() is already
doing very similar things and is the central interface for managing block
allocation instead of having a filesystem-specific ioctl() to do this.
Cheers, Andreas
Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)
Powered by blists - more mailing lists