Re: [PATCH] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES

Pankaj Raghav <[email protected]>
Newsgroups org.kernel.vger.linux-man,org.kernel.vger.linux-ext4,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
> FALLOC_FL_WRITE_ZEROES itself is relatively flexible. It does not
> mandate that the filesystem must implement zeroing via unmap write
> zeroes. That depends on the specific implementation of each filesystem.
> Currently, ext4, xfs, and block devices (bdev) support this operation
> through that approach, since writing zeros directly on devices that do
> not support unmap zeroes can be very slow and thus of little practical
> value.
> 
> Therefore, I would suggest referring to the description in, for
> example, fallocate(1):
> 
> https://man7.org/linux/man-pages/man1/fallocate.1.html
> 
>   "Zeroing is done within the filesystem. The
>    filesystem may use a hardware-accelerated zeroing command or may
>    submit regular writes. The behavior depends on the filesystem design
>    and the available hardware."
> 
> What do you think?
> 

You are right. It is up to the FSs to implement however it wants.
I will use this framing instead. Thanks.

>> +This approach means that the specified range will be physically zeroed out
>> +on the device (including partial blocks at the either end of the range).
>> +.P
>> +No other flags may be specified in
>> +.I mode
>> +in conjunction with
>> +.BR FALLOC_FL_WRITE_ZEROES .
>> +.P
>> +Not all filesystems support
>> +.BR FALLOC_FL_WRITE_ZEROES ;
>> +if a filesystem doesn't support the operation, an error is returned.
>> +The operation is supported only in ext4 (since Linux 6.17).
>                                       ^^^^
> ext4 (only for extent-based files)
> 

Sounds good.

--
Pankaj
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.