diff options
Diffstat (limited to 'src/copy.h')
-rw-r--r-- | src/copy.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/copy.h b/src/copy.h index cdef64a7f..745533aec 100644 --- a/src/copy.h +++ b/src/copy.h @@ -43,6 +43,19 @@ enum Sparse_type SPARSE_ALWAYS }; +/* Control creation of COW files. */ +enum Reflink_type +{ + /* Default to a standard copy. */ + REFLINK_NEVER, + + /* Try a COW copy and fall back to a standard copy. */ + REFLINK_AUTO, + + /* Require a COW copy and fail if not available. */ + REFLINK_ALWAYS +}; + /* This type is used to help mv (via copy.c) distinguish these cases. */ enum Interactive { @@ -73,6 +86,11 @@ enum Dereference_symlink || (Mode) == SPARSE_AUTO \ || (Mode) == SPARSE_ALWAYS) +# define VALID_REFLINK_MODE(Mode) \ + ((Mode) == REFLINK_NEVER \ + || (Mode) == REFLINK_AUTO \ + || (Mode) == REFLINK_ALWAYS) + /* These options control how files are copied by at least the following programs: mv (when rename doesn't work), cp, install. So, if you add a new member, be sure to initialize it in @@ -219,8 +237,8 @@ struct cp_options such a symlink) and returns false. */ bool open_dangling_dest_symlink; - /* If true, attempt to clone the file instead of copying it. */ - bool reflink; + /* Control creation of COW files. */ + enum Reflink_type reflink_mode; /* This is a set of destination name/inode/dev triples. Each such triple represents a file we have created corresponding to a source file name |