Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/fspacectl.2
Show All 18 Lines | |||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.Dd Feb 08, 2021 | .Dd February 8, 2021 | ||||
.Dt FSPACECTL 2 | .Dt FSPACECTL 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm fspacectl | .Nm fspacectl | ||||
.Nd space management in a file | .Nd space management in a file | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Show All 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. | ||||
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 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 | ||||
If signal is delivered to a thread calling this system call, | If signal is delivered to a thread calling this system call, | ||||
the system call would either finish as if nothing has happened, | the system call would either finish as if nothing has happened, | ||||
or signal would be delivered after the operation finishes. | or signal would be delivered after the operation finishes. | ||||
.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 | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |
...argument within the file system space.