]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/ioctl_ficlonerange.2
pow.3: Minor tweak to BUGS
[thirdparty/man-pages.git] / man2 / ioctl_ficlonerange.2
index c4715d042fb626f7dd6f87d826d7260c52626bd2..c1b108acb9d5507b41210bf84a4662d703a2d2b1 100644 (file)
@@ -20,7 +20,7 @@
 .\" License along with this manual; if not, see
 .\" <http://www.gnu.org/licenses/>.
 .\" %%%LICENSE_END
-.TH IOCTL-FICLONERANGE 2 2016-02-10 "Linux" "Linux Programmer's Manual"
+.TH IOCTL_FICLONERANGE 2 2017-09-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 ioctl_ficlonerange, ioctl_ficlone \- share some the data of one file with another file
 .SH SYNOPSIS
@@ -28,8 +28,8 @@ ioctl_ficlonerange, ioctl_ficlone \- share some the data of one file with anothe
 .B #include <sys/ioctl.h>
 .br
 .B #include <linux/fs.h>
-.sp
-.BI "int ioctl(int " dest_fd ", FICLONERANGE, struct file_clone_range * " arg );
+.PP
+.BI "int ioctl(int " dest_fd ", FICLONERANGE, struct file_clone_range *" arg );
 .br
 .BI "int ioctl(int " dest_fd ", FICLONE, int " src_fd );
 .SH DESCRIPTION
@@ -47,7 +47,7 @@ If a file write should occur to a shared region,
 the filesystem must ensure that the changes remain private to the file being
 written.
 This behavior is commonly referred to as "copy on write".
-
+.PP
 This ioctl reflinks up to
 .IR src_length
 bytes from file descriptor
@@ -64,21 +64,21 @@ If
 is zero, the ioctl reflinks to the end of the source file.
 This information is conveyed in a structure of
 the following form:
+.PP
 .in +4n
-.nf
-
+.EX
 struct file_clone_range {
     __s64 src_fd;
     __u64 src_offset;
     __u64 src_length;
     __u64 dest_offset;
 };
-
-.fi
+.EE
 .in
+.PP
 Clones are atomic with regards to concurrent writes, so no locks need to be
 taken to obtain a consistent cloned copy.
-
+.PP
 The
 .B FICLONE
 ioctl clones entire files.
@@ -90,13 +90,14 @@ is set to indicate the error.
 .SH ERRORS
 Error codes can be one of, but are not limited to, the following:
 .TP
-.B EXDEV
-.IR dest_fd " and " src_fd
-are not on the same mounted filesystem.
-.TP
-.B EISDIR
-One of the files is a directory and the filesystem does not support shared
-regions in directories.
+.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
+.IR src_fd
+resides on does not support reflink.
 .TP
 .B EINVAL
 The filesystem does not support reflinking the ranges of the given files.
@@ -107,14 +108,13 @@ to be aligned to the fundamental block size.
 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
-.IR src_fd
-resides on does not support reflink.
+.B EISDIR
+One of the files is a directory and the filesystem does not support shared
+regions in directories.
+.TP
+.B EOPNOTSUPP
+This can appear if the filesystem does not support reflinking either file
+descriptor, or if either file descriptor refers to special inodes.
 .TP
 .B EPERM
 .IR dest_fd
@@ -124,9 +124,9 @@ is immutable.
 One of the files is a swap file.
 Swap files cannot share storage.
 .TP
-.B EOPNOTSUPP
-This can appear if the filesystem does not support reflinking either file
-descriptor.
+.B EXDEV
+.IR dest_fd " and " src_fd
+are not on the same mounted filesystem.
 .SH VERSIONS
 These ioctl operations first appeared in Linux 4.5.
 They were previously known as