summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-08-26 00:32:43 +0100
committerPádraig Brady <P@draigBrady.com>2009-08-29 00:24:49 +0100
commit72f98388c36676e5c9ba6a72df5693c207862204 (patch)
treef0f54bfdb3a16d87cd180226021de9a7570bd9e7 /doc
parentf296cf4052c5299c7e6b1c14dcffa4785982a8ce (diff)
downloadcoreutils-72f98388c36676e5c9ba6a72df5693c207862204.tar.xz
cp --reflink: add an "auto" parameter to fall back to a normal copy
* doc/coreutils.texi (cp invocation): Document the new "auto" and "always" options to --reflink. * src/copy.c (copy_reg): Fall back to a standard copy when reflink() is not supported and --reflink=auto specified. * src/copy.h [struct cp_options] (reflink): Change type s/bool/enum/. * src/cp.c (usage): Describe the --reflink={always,auto} options and expand a little on what --reflink does. (main): parse the new parameters to --reflink and allow all --sparse options with --reflink=auto. * src/install.c (cp_option_init): Init the enum instead of bool. * src/mv.c (cp_option_init): Likewise. * tests/cp/reflink-auto: A new test for falling back to normal copy. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi22
1 files changed, 19 insertions, 3 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8e1b73d63..f4be2c2f0 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7543,15 +7543,31 @@ Also, it is not portable to use @option{-R} to copy symbolic links
unless you also specify @option{-P}, as @acronym{POSIX} allows
implementations that dereference symbolic links by default.
-@item --reflink
-@opindex --reflink
+@item --reflink[=@var{when}]
+@opindex --reflink[=@var{when}]
+@cindex COW
+@cindex clone
+@cindex copy on write
Perform a lightweight, copy-on-write (COW) copy.
-Copying with this option can succeed only on some relatively new file systems.
+Copying with this option can succeed only on some file systems.
Once it has succeeded, beware that the source and destination files
share the same disk data blocks as long as they remain unmodified.
Thus, if a disk I/O error affects data blocks of one of the files,
the other suffers the exact same fate.
+The @var{when} value can be one of the following:
+
+@table @samp
+@item always
+The default behavior: if the copy-on-write operation is not supported
+then report the failure for each file and exit with a failure status.
+
+@item auto
+If the copy-on-write operation is not supported then fall back
+to the standard copy behaviour.
+@end table
+
+
@item --remove-destination
@opindex --remove-destination
Remove each existing destination file before attempting to open it