Re: [PATCH] fallocate: add FALLOC_FL_ZERO_RANGE support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2 Apr 2014, Pádraig Brady wrote:

> Date: Wed, 02 Apr 2014 13:27:08 +0100
> From: Pádraig Brady <P@xxxxxxxxxxxxxx>
> To: Lukas Czerner <lczerner@xxxxxxxxxx>
> Cc: util-linux@xxxxxxxxxxxxxxx, kzak@xxxxxxxxxx
> Subject: Re: [PATCH] fallocate: add FALLOC_FL_ZERO_RANGE support
> 
> On 04/02/2014 12:31 PM, Lukas Czerner wrote:
> > Recent Linux kernel supports FALLOC_FL_ZERO_RANGE in fallocate(2).
> > This patch adds FALLOC_FL_ZERO_RANGE support to fallocate utility,
> > by introducing a new option -z|--zero-range.
> > 
> > Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
> 
> Looks good thanks.
> 
> I was wondering how this interacts with the --dig-holes option.
> That looks for ranges of zeros as efficiently as possible to turn them into holes.
> It uses SEEK_DATA for that, so I was wondering if these preallocated
> ranges of zeroes are treated specially in that regard?
> Note one could use fiemap to distinguish these ranges,
> but it's buggy as one needs to sync the file before using it.

It's currently implemented by ext4 and xfs and what it does is that
it converts initialized extents to initialized and preallocates
holes within that range.

Preallocated (unwritten) extents are indeed treated differently at
least in ext4 (not sure about other fs). If we encounter unwritten
extent we would check the page cache whether there are any data for
a given extent and treat it as DATA, or HOLE respectively.

Btw, you can create unwritten extent just with fallocate itself as
well.

Thanks!
-Lukas

> 
> thanks,
> Pádraig.
> 
> 

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux