* [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks @ 2016-10-18 1:54 Darrick J. Wong 2016-10-18 1:54 ` [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more Darrick J. Wong 2016-10-18 6:06 ` [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks Michael Kerrisk (man-pages) 0 siblings, 2 replies; 4+ messages in thread From: Darrick J. Wong @ 2016-10-18 1:54 UTC (permalink / raw) To: mtk.manpages, darrick.wong Cc: linux-fsdevel, linux-api, linux-xfs, linux-btrfs, linux-man Add a blurb to the fallocate manpage explaining that the fallocate command with the UNSHARE mode flag may use CoW to unshare blocks to guarantee that a disk write won't fail with ENOSPC. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- man2/fallocate.2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/man2/fallocate.2 b/man2/fallocate.2 index 54d6340..3ed1460 100644 --- a/man2/fallocate.2 +++ b/man2/fallocate.2 @@ -79,6 +79,16 @@ but the file size will not be changed even if is greater than the file size. Preallocating zeroed blocks beyond the end of the file in this manner is useful for optimizing append workloads. + +If the +.B FALLOC_FL_UNSHARE +flag is specified in +.IR mode , +shared file data extents will be made private to the file to guarantee +that a subsequent write will not fail due to lack of space. +Typically, this will be done by performing a copy-on-write operation on +all shared data in the file. +This flag may not be supported by all filesystems. .PP Because allocation is done in block size chunks, .BR fallocate () ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more 2016-10-18 1:54 [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks Darrick J. Wong @ 2016-10-18 1:54 ` Darrick J. Wong 2016-10-18 6:11 ` Michael Kerrisk (man-pages) 2016-10-18 6:06 ` [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks Michael Kerrisk (man-pages) 1 sibling, 1 reply; 4+ messages in thread From: Darrick J. Wong @ 2016-10-18 1:54 UTC (permalink / raw) To: mtk.manpages, darrick.wong Cc: linux-fsdevel, linux-api, linux-xfs, linux-btrfs, linux-man Clarify the behavior of the dedupe ioctl. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- man2/ioctl_ficlonerange.2 | 2 +- man2/ioctl_fideduperange.2 | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/man2/ioctl_ficlonerange.2 b/man2/ioctl_ficlonerange.2 index ac0738a..0e3ae0e 100644 --- a/man2/ioctl_ficlonerange.2 +++ b/man2/ioctl_ficlonerange.2 @@ -114,7 +114,7 @@ regions in directories. .TP .B EOPNOTSUPP This can appear if the filesystem does not support reflinking either file -descriptor. +descriptor, or if either file descriptor refers to special inodes. .TP .B EPERM .IR dest_fd diff --git a/man2/ioctl_fideduperange.2 b/man2/ioctl_fideduperange.2 index c52fa2a..2112d10 100644 --- a/man2/ioctl_fideduperange.2 +++ b/man2/ioctl_fideduperange.2 @@ -99,21 +99,39 @@ Each deduplication operation targets bytes in file descriptor .IR dest_fd at offset -.IR logical_offset ". +.IR dest_offset ". The field .IR reserved must be zero. +During the call, +.IR src_fd +must be open for reading and +.IR dest_fd +must be open for writing. +For any call to this ioctl, there may not be more than 65,536 +requests attached; each request may not exceed 16MiB. +By convention, the storage used by +.IR src_fd +is mapped into +.IR dest_fd +and the previous contents in +.IR dest_fd +are freed. Upon successful completion of this ioctl, the number of bytes successfully deduplicated is returned in .IR bytes_deduped and a status code for the deduplication operation is returned in .IR status ". - +If even a single byte in the range does not match, the deduplication +request will be ignored and +.IR status +set to +.BR FILE_DEDUPE_RANGE_DIFFERS . The .IR status code is set to -.B 0 +.B FILE_DEDUPE_RANGE_SAME for success, a negative error code in case of error, or .B FILE_DEDUPE_RANGE_DIFFERS if the data did not match. @@ -150,7 +168,7 @@ regions in directories. .TP .B EOPNOTSUPP This can appear if the filesystem does not support deduplicating either file -descriptor. +descriptor, or if either file descriptor refers to special inodes. .TP .B EPERM .IR dest_fd ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more 2016-10-18 1:54 ` [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more Darrick J. Wong @ 2016-10-18 6:11 ` Michael Kerrisk (man-pages) 0 siblings, 0 replies; 4+ messages in thread From: Michael Kerrisk (man-pages) @ 2016-10-18 6:11 UTC (permalink / raw) To: Darrick J. Wong Cc: mtk.manpages, linux-fsdevel, linux-api, linux-xfs, linux-btrfs, linux-man Hi Darrick, On 10/18/2016 03:54 AM, Darrick J. Wong wrote: > Clarify the behavior of the dedupe ioctl. Thanks! Applied. Cheers, Michael > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> > --- > man2/ioctl_ficlonerange.2 | 2 +- > man2/ioctl_fideduperange.2 | 26 ++++++++++++++++++++++---- > 2 files changed, 23 insertions(+), 5 deletions(-) > > > diff --git a/man2/ioctl_ficlonerange.2 b/man2/ioctl_ficlonerange.2 > index ac0738a..0e3ae0e 100644 > --- a/man2/ioctl_ficlonerange.2 > +++ b/man2/ioctl_ficlonerange.2 > @@ -114,7 +114,7 @@ regions in directories. > .TP > .B EOPNOTSUPP > This can appear if the filesystem does not support reflinking either file > -descriptor. > +descriptor, or if either file descriptor refers to special inodes. > .TP > .B EPERM > .IR dest_fd > diff --git a/man2/ioctl_fideduperange.2 b/man2/ioctl_fideduperange.2 > index c52fa2a..2112d10 100644 > --- a/man2/ioctl_fideduperange.2 > +++ b/man2/ioctl_fideduperange.2 > @@ -99,21 +99,39 @@ Each deduplication operation targets > bytes in file descriptor > .IR dest_fd > at offset > -.IR logical_offset ". > +.IR dest_offset ". > The field > .IR reserved > must be zero. > +During the call, > +.IR src_fd > +must be open for reading and > +.IR dest_fd > +must be open for writing. > +For any call to this ioctl, there may not be more than 65,536 > +requests attached; each request may not exceed 16MiB. > +By convention, the storage used by > +.IR src_fd > +is mapped into > +.IR dest_fd > +and the previous contents in > +.IR dest_fd > +are freed. > > Upon successful completion of this ioctl, the number of bytes successfully > deduplicated is returned in > .IR bytes_deduped > and a status code for the deduplication operation is returned in > .IR status ". > - > +If even a single byte in the range does not match, the deduplication > +request will be ignored and > +.IR status > +set to > +.BR FILE_DEDUPE_RANGE_DIFFERS . > The > .IR status > code is set to > -.B 0 > +.B FILE_DEDUPE_RANGE_SAME > for success, a negative error code in case of error, or > .B FILE_DEDUPE_RANGE_DIFFERS > if the data did not match. > @@ -150,7 +168,7 @@ regions in directories. > .TP > .B EOPNOTSUPP > This can appear if the filesystem does not support deduplicating either file > -descriptor. > +descriptor, or if either file descriptor refers to special inodes. > .TP > .B EPERM > .IR dest_fd > > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks 2016-10-18 1:54 [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks Darrick J. Wong 2016-10-18 1:54 ` [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more Darrick J. Wong @ 2016-10-18 6:06 ` Michael Kerrisk (man-pages) 1 sibling, 0 replies; 4+ messages in thread From: Michael Kerrisk (man-pages) @ 2016-10-18 6:06 UTC (permalink / raw) To: Darrick J. Wong Cc: mtk.manpages, linux-fsdevel, linux-api, linux-xfs, linux-btrfs, linux-man Hi Darrick, On 10/18/2016 03:54 AM, Darrick J. Wong wrote: > Add a blurb to the fallocate manpage explaining that the fallocate > command with the UNSHARE mode flag may use CoW to unshare blocks to > guarantee that a disk write won't fail with ENOSPC. Thanks! Applied. Cheers, Michael > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> > --- > man2/fallocate.2 | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > > diff --git a/man2/fallocate.2 b/man2/fallocate.2 > index 54d6340..3ed1460 100644 > --- a/man2/fallocate.2 > +++ b/man2/fallocate.2 > @@ -79,6 +79,16 @@ but the file size will not be changed even if > is greater than the file size. > Preallocating zeroed blocks beyond the end of the file in this manner > is useful for optimizing append workloads. > + > +If the > +.B FALLOC_FL_UNSHARE > +flag is specified in > +.IR mode , > +shared file data extents will be made private to the file to guarantee > +that a subsequent write will not fail due to lack of space. > +Typically, this will be done by performing a copy-on-write operation on > +all shared data in the file. > +This flag may not be supported by all filesystems. > .PP > Because allocation is done in block size chunks, > .BR fallocate () > > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-18 6:12 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-10-18 1:54 [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks Darrick J. Wong 2016-10-18 1:54 ` [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more Darrick J. Wong 2016-10-18 6:11 ` Michael Kerrisk (man-pages) 2016-10-18 6:06 ` [PATCH 1/2] man2/fallocate.2: document behavior with shared blocks Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).