|
38 | 38 | #include <string.h> |
39 | 39 | #include <sys/types.h> |
40 | 40 | #include <sys/stat.h> |
| 41 | +#ifdef HAVE_SYS_IOCTL_H |
| 42 | +#include <sys/ioctl.h> // FICLONE |
| 43 | +#endif |
41 | 44 |
|
42 | 45 | #include "lib/global.h" |
43 | 46 |
|
@@ -569,6 +572,7 @@ configure_box (void) |
569 | 572 | QUICK_CHECKBOX (_ ("Mkdi&r autoname"), &auto_fill_mkdir_name, NULL), |
570 | 573 | QUICK_CHECKBOX (_ ("&Preallocate space"), &mc_global.vfs.preallocate_space, |
571 | 574 | NULL), |
| 575 | + QUICK_CHECKBOX (_ ("Use COW file cloning"), &mc_global.vfs.file_cloning, NULL), |
572 | 576 | QUICK_STOP_GROUPBOX, |
573 | 577 | QUICK_START_GROUPBOX (_ ("Esc key mode")), |
574 | 578 | QUICK_CHECKBOX (_ ("S&ingle press"), &old_esc_mode, &configure_old_esc_mode_id), |
@@ -619,17 +623,22 @@ configure_box (void) |
619 | 623 | g_snprintf (time_out, sizeof (time_out), "%d", old_esc_mode_timeout); |
620 | 624 |
|
621 | 625 | #ifndef USE_INTERNAL_EDIT |
622 | | - quick_widgets[17].state = WST_DISABLED; |
| 626 | + quick_widgets[18].state = WST_DISABLED; |
623 | 627 | #endif |
624 | 628 |
|
625 | 629 | if (!old_esc_mode) |
626 | | - quick_widgets[10].state = WST_DISABLED; |
| 630 | + quick_widgets[11].state = WST_DISABLED; |
627 | 631 |
|
628 | 632 | #ifndef HAVE_POSIX_FALLOCATE |
629 | 633 | mc_global.vfs.preallocate_space = FALSE; |
630 | 634 | quick_widgets[6].state = WST_DISABLED; |
631 | 635 | #endif |
632 | 636 |
|
| 637 | +#if !defined(FICLONE) && !defined(HAVE_COPY_FILE_RANGE) && !defined(HAVE_SYS_CLONEFILE_H) && !defined(HAVE_REFLINK) |
| 638 | + mc_global.vfs.file_cloning = FALSE; |
| 639 | + quick_widgets[7].state = WST_DISABLED; |
| 640 | +#endif |
| 641 | + |
633 | 642 | if (quick_dialog (&qdlg) == B_ENTER) |
634 | 643 | { |
635 | 644 | if (time_out_new[0] == '\0') |
|
0 commit comments