>From adac27b8321907ed784b69be7bb0d7d2486c85de Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 18 Jun 2018 00:38:04 +0200 Subject: [PATCH] cp: --reflink=never to force no-reflink mode This is currently the default, but most if not all users of reflink-capable filesystems want --reflink=auto, which is often encapsulated into an alias. Adding --reflink=never allows overriding such an alias. --- doc/coreutils.texi | 3 +++ src/cp.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index c28b8d043..0691ce6da 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8740,6 +8740,9 @@ 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 behavior. + +@item never +Disable reflink: perform a heavy-weight copy that takes the full disk space. @end table This option is overridden by the @option{--link}, @option{--symbolic-link} diff --git a/src/cp.c b/src/cp.c index 04cbd4b33..ffb345b24 100644 --- a/src/cp.c +++ b/src/cp.c @@ -96,11 +96,11 @@ ARGMATCH_VERIFY (sparse_type_string, sparse_type); static char const *const reflink_type_string[] = { - "auto", "always", NULL + "auto", "always", "never", NULL }; static enum Reflink_type const reflink_type[] = { - REFLINK_AUTO, REFLINK_ALWAYS + REFLINK_AUTO, REFLINK_ALWAYS, REFLINK_NEVER }; ARGMATCH_VERIFY (reflink_type_string, reflink_type); -- 2.17.1