Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/fspacectl.2
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | struct spacectl_range { | ||||
off_t r_len; | off_t r_len; | ||||
}; | }; | ||||
.Ed | .Ed | ||||
.Pp | .Pp | ||||
The operation specified by the | The operation specified by the | ||||
.Fa cmd | .Fa cmd | ||||
argument may be one of: | argument may be one of: | ||||
.Bl -tag -width SPACECTL_DEALLOC | .Bl -tag -width SPACECTL_DEALLOC | ||||
.It Dv SPACECTL_ALLOC | |||||
Back a region in the file specified by the | |||||
.Fa range | |||||
argument within the file system space. | |||||
gbe: ...argument within the file system space. | |||||
Subsequent operations in the region will not fail due to lack of free space in | |||||
the file system. | |||||
This operation is used to implement | |||||
Done Inline Actions...for a non-hole region. gbe: ...for a non-hole region. | |||||
.Xr posix_fallocate 2 . | |||||
Content will remain the same for a non-hole region. | |||||
Holes will be converted to non-hole region with zeroes. | |||||
.It Dv SPACECTL_DEALLOC | .It Dv SPACECTL_DEALLOC | ||||
Zero a region in the file specified by the | Zero a region in the file specified by the | ||||
.Fa range | .Fa range | ||||
argument. | argument. | ||||
The | The | ||||
.Va "range->r_offset" | .Va "range->r_offset" | ||||
has to be a value greater than or equal to 0, and the | has to be a value greater than or equal to 0, and the | ||||
.Va "range->r_len" | .Va "range->r_len" | ||||
has to be a value greater than 0. | has to be a value greater than 0. | ||||
.Pp | .Pp | ||||
If the file system supports hole-punching, | If the file system supports hole-punching, | ||||
file system space deallocation may be performed in the given region. | file system space deallocation may be performed in the given region. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fa flags | .Fa flags | ||||
argument needs to be the value 0 currently. | argument may include one or more of the following: | ||||
.Bl -tag -width SPACECTL_F_CANEXTEND | |||||
.It Dv SPACECTL_F_CANEXTEND | |||||
The operation can extend the file size if | |||||
.Fa range->r_offset | |||||
+ | |||||
.Fa range->r_len | |||||
is greater than the current file size. | |||||
This flag is supported by the | |||||
.Dv SPACECTL_ALLOC | |||||
operation. | |||||
.El | |||||
.Pp | .Pp | ||||
The call does not return partial success if a signal is caught during execution. | The call does not return partial success if a signal is caught during execution. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
Upon successful completion, the value 0 is returned; | Upon successful completion, the value 0 is returned; | ||||
otherwise the value -1 is returned and | otherwise the value -1 is returned and | ||||
.Va errno | .Va errno | ||||
is set to indicate the error. | is set to indicate the error. | ||||
.Sh ERRORS | .Sh ERRORS | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |
...argument within the file system space.