X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/5e3c6c93f546d8015f6b061348d8815c807d8f1a..4db3c954ec3cad51048587cdded6ac4759adcef8:/preallocate.diff diff --git a/preallocate.diff b/preallocate.diff index 9d2ccb3..39ad416 100644 --- a/preallocate.diff +++ b/preallocate.diff @@ -9,12 +9,9 @@ To use this patch, run these commands for a successful build: ./configure make - -TODO: update docs - --- old/configure.in +++ new/configure.in -@@ -550,7 +550,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd +@@ -555,7 +555,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \ setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \ strerror putenv iconv_open locale_charset nl_langinfo \ @@ -81,7 +78,7 @@ TODO: update docs {"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 }, {"append", 0, POPT_ARG_VAL, &append_mode, 1, 0, 0 }, {"del", 0, POPT_ARG_NONE, &delete_during, 0, 0, 0 }, -@@ -1126,6 +1136,15 @@ int parse_arguments(int *argc, const cha +@@ -1132,6 +1142,15 @@ int parse_arguments(int *argc, const cha } #endif @@ -97,7 +94,7 @@ TODO: update docs if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n"); -@@ -1764,6 +1783,9 @@ void server_options(char **args,int *arg +@@ -1779,6 +1798,9 @@ void server_options(char **args,int *arg else if (remove_source_files) args[ac++] = "--remove-sent-files"; @@ -109,7 +106,7 @@ TODO: update docs --- old/receiver.c +++ new/receiver.c -@@ -43,6 +43,7 @@ extern int cleanup_got_literal; +@@ -44,6 +44,7 @@ extern int cleanup_got_literal; extern int remove_source_files; extern int append_mode; extern int sparse_files; @@ -160,7 +157,7 @@ TODO: update docs if (do_progress) --- old/rsync.h +++ new/rsync.h -@@ -493,6 +493,10 @@ struct idev { +@@ -546,6 +546,10 @@ struct idev_node { #define IN_LOOPBACKNET 127 #endif @@ -170,7 +167,37 @@ TODO: update docs + #define GID_NONE ((gid_t)-1) - #define HL_CHECK_MASTER 0 + union file_extras { +--- old/rsync.yo ++++ new/rsync.yo +@@ -332,6 +332,7 @@ to the detailed description below for a + -O, --omit-dir-times omit directories when preserving times + --super receiver attempts super-user activities + -S, --sparse handle sparse files efficiently ++ --preallocate posix_fallocate dest files before writing + -n, --dry-run show what would have been transferred + -W, --whole-file copy files whole (without rsync algorithm) + -x, --one-file-system don't cross filesystem boundaries +@@ -888,6 +889,19 @@ NOTE: Don't use this option when the des + filesystem. It doesn't seem to handle seeks over null regions + correctly and ends up corrupting the files. + ++dit(bf(--preallocate)) This tells the receiver to allocate each destination ++file to its eventual size using bf(posix_fallocate)(3) before writing data ++to the file. If the receiver is remote, this nonstandard option only works ++if the receiver also has the preallocation patch. Furthermore, this option ++only works if the receiver found the bf(posix_fallocate)(3) call at ++configure time. ++ ++Without this option on MS Windows, very large destination files tend to be ++broken into thousands of fragments; advising Windows ahead of time of the ++eventual file size using this option usually reduces the number of ++fragments to one. However, on Linux, this option appears to just waste ++disk I/O. ++ + dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers, + instead it will just report the actions it would have taken. + --- old/t_stub.c +++ new/t_stub.c @@ -23,6 +23,7 @@