ioctl_ficlonerange.2: Minor tweaks

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-06-08 12:17:02 +02:00
parent 1d691addc2
commit 603fc95a2b
1 changed files with 20 additions and 18 deletions

View File

@ -30,10 +30,10 @@ ioctl_ficlonerange, ioctl_ficlone \- share some the data of one file with anothe
If a filesystem supports files sharing physical storage between multiple
files ("reflink"), this
.BR ioctl (2)
system call can be used to make some of the data in the
.B src_fd
operation can be used to make some of the data in the
.I src_fd
file appear in the
.B dest_fd
.I dest_fd
file by sharing the underlying storage, which is faster than making a separate
physical copy of the data.
If a file write should occur to a shared region,
@ -58,10 +58,10 @@ the following form:
.nf
struct file_clone_range {
__s64 src_fd;
__u64 src_offset;
__u64 src_length;
__u64 dest_offset;
__s64 src_fd;
__u64 src_offset;
__u64 src_length;
__u64 dest_offset;
};
.fi
@ -69,7 +69,9 @@ struct file_clone_range {
Clones are atomic with regards to concurrent writes, so no locks need to be
taken to obtain a consistent cloned copy.
The FICLONE ioctl clones entire files.
The
.B FICLONE
ioctl clones entire files.
.SH RETURN VALUE
On error, \-1 is returned, and
.I errno
@ -89,18 +91,18 @@ regions in directories.
.B EINVAL
The filesystem does not support reflinking the ranges of the given files.
This error can also appear if either file descriptor represents
a device, fifo, or socket.
a device, FIFO, or socket.
Disk filesystems generally require the offset and length arguments
to be aligned to the fundamental block size.
XFS and btrfs do not support
XFS and Btrfs do not support
overlapping reflink ranges in the same file.
.TP
.B EBADF
.IR src_fd
is not open for reading;
.IR dest_fd
is not open for writing or is open for append-only writes; or the filesystem
which
is not open for writing or is open for append-only writes;
or the filesystem which
.IR src_fd
resides on does not support reflink.
.TP
@ -115,17 +117,17 @@ Swap files cannot share storage.
.B EOPNOTSUPP
This can appear if the filesystem does not support reflinking either file
descriptor.
.SH NOTES
Because a copy on write operation requires the allocation of new storage, the
.B fallocate (2)
operation may un-share shared blocks to guarantee that subsequent writes will
not fail because of lack of disk space.
.SH CONFORMING TO
This API is Linux-specific.
This ioctl was previously known as
.B BTRFS_IOC_CLONE_RANGE
and was private to btrfs.
and was private to Btrfs.
.fi
.in
.SH NOTES
Because a copy-on-write operation requires the allocation of new storage, the
.BR fallocate (2)
operation may unshare shared blocks to guarantee that subsequent writes will
not fail because of lack of disk space.
.SH SEE ALSO
.BR ioctl (2)