From 1fd4f609ee65be0f376ed28322fc3593026d39e4 Mon Sep 17 00:00:00 2001 From: Lukas Czerner Date: Wed, 2 Apr 2014 13:31:05 +0200 Subject: fallocate: add FALLOC_FL_ZERO_RANGE support 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 --- sys-utils/fallocate.1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sys-utils/fallocate.1') diff --git a/sys-utils/fallocate.1 b/sys-utils/fallocate.1 index 634c595b4..1177cf389 100644 --- a/sys-utils/fallocate.1 +++ b/sys-utils/fallocate.1 @@ -7,6 +7,7 @@ fallocate \- preallocate or deallocate space to a file .RB [ \-n ] .RB [ \-p ] .RB [ \-c ] +.RB [ \-z ] .RB [ \-o .IR offset ] .B \-l @@ -46,6 +47,9 @@ Do not modify the apparent length of the file. This may effectively allocate blocks past EOF, which can be removed with a truncate. .IP "\fB\-p, \-\-punch-hole\fP" Punch holes in the file, the range should not exceed the length of the file. +This option may not be specified at the same time as the +.B \-z +option. .IP "\fB\-d, \-\-dig-holes\fP" Detect and dig holes. Makes the file sparse in-place, without using extra disk space. The minimal size of the hole depends on filesystem I/O block size @@ -61,6 +65,16 @@ Collapse a particular file range to nullify the hole. Extents beyond the range command does not leave a hole, while \fI\-\-punch-hole\fP leaves a hole instead of shifting extents. Both offset and length should be aligned to the block size of filesystem. +.IP "\fB\-z, \-\-zero-range\fP" +Zero range in the file. Regions that span holes in the file will be +preallocated, this includes areas past EOF. Option +.B \-n +can be specified to prevent file length modification. Reads from the range +will return zeros. This option may not be specified at the same time as the +.B \-p +or +.B \-c +option. .IP "\fB\-o, \-\-offset\fP \fIoffset\fP Specifies the beginning offset of the allocation, in bytes. .IP "\fB\-l, \-\-length\fP \fIlength\fP -- cgit v1.2.3-55-g7522