X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/cc3e685d09b2095099fc396157d19172ab3ef7c4..4c15e80040f6ac2fc79d599d1722cf209cc30536:/preallocate.diff diff --git a/preallocate.diff b/preallocate.diff index 6c43dbe..f5f21a4 100644 --- a/preallocate.diff +++ b/preallocate.diff @@ -19,12 +19,12 @@ diff --git a/configure.in b/configure.in - extattr_get_link sigaction sigprocmask setattrlist) + extattr_get_link sigaction sigprocmask setattrlist posix_fallocate) - AC_CHECK_FUNCS(getpgrp tcgetpgrp) - if test $ac_cv_func_getpgrp = yes; then + dnl cygwin iconv.h defines iconv_open as libiconv_open + if test x"$ac_cv_func_iconv_open" != x"yes"; then diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -71,6 +71,7 @@ int remove_source_files = 0; +@@ -72,6 +72,7 @@ int remove_source_files = 0; int one_file_system = 0; int protocol_version = PROTOCOL_VERSION; int sparse_files = 0; @@ -32,7 +32,7 @@ diff --git a/options.c b/options.c int do_compression = 0; int def_compress_level = Z_DEFAULT_COMPRESSION; int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */ -@@ -222,6 +223,7 @@ static void print_rsync_version(enum logcode f) +@@ -223,6 +224,7 @@ static void print_rsync_version(enum logcode f) char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -40,7 +40,7 @@ diff --git a/options.c b/options.c STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -251,6 +253,9 @@ static void print_rsync_version(enum logcode f) +@@ -252,6 +254,9 @@ static void print_rsync_version(enum logcode f) #ifdef ICONV_OPTION iconv = ""; #endif @@ -50,7 +50,7 @@ diff --git a/options.c b/options.c rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -264,8 +269,8 @@ static void print_rsync_version(enum logcode f) +@@ -265,8 +270,8 @@ static void print_rsync_version(enum logcode f) (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); @@ -61,7 +61,7 @@ diff --git a/options.c b/options.c #ifdef MAINTAINER_MODE rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); -@@ -352,6 +357,9 @@ void usage(enum logcode F) +@@ -353,6 +358,9 @@ void usage(enum logcode F) rprintf(F," --fake-super store/recover privileged attrs using xattrs\n"); #endif rprintf(F," -S, --sparse handle sparse files efficiently\n"); @@ -69,9 +69,9 @@ diff --git a/options.c b/options.c + rprintf(F," --preallocate posix_fallocate dest files before writing them\n"); +#endif rprintf(F," -n, --dry-run perform a trial run with no changes made\n"); - rprintf(F," -W, --whole-file copy files whole (without rsync algorithm)\n"); + rprintf(F," -W, --whole-file copy files whole (without delta-xfer algorithm)\n"); rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n"); -@@ -530,6 +538,7 @@ static struct poptOption long_options[] = { +@@ -531,6 +539,7 @@ static struct poptOption long_options[] = { {"max-size", 0, POPT_ARG_STRING, &max_size_arg, OPT_MAX_SIZE, 0, 0 }, {"min-size", 0, POPT_ARG_STRING, &min_size_arg, OPT_MIN_SIZE, 0, 0 }, {"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 }, @@ -79,7 +79,7 @@ diff --git a/options.c b/options.c {"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 }, {"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 }, {"append-verify", 0, POPT_ARG_VAL, &append_mode, 2, 0, 0 }, -@@ -1287,6 +1296,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1289,6 +1298,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) } #endif @@ -95,7 +95,7 @@ diff --git a/options.c b/options.c if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n"); -@@ -1991,6 +2009,9 @@ void server_options(char **args, int *argc_p) +@@ -1999,6 +2017,9 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; @@ -180,7 +180,7 @@ diff --git a/rsync.yo b/rsync.yo -S, --sparse handle sparse files efficiently + --preallocate posix_fallocate dest files before writing -n, --dry-run perform a trial run with no changes made - -W, --whole-file copy files whole (without rsync algorithm) + -W, --whole-file copy files whole (w/o delta-xfer algorithm) -x, --one-file-system don't cross filesystem boundaries @@ -1023,6 +1024,19 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs" filesystem. It doesn't seem to handle seeks over null regions @@ -224,7 +224,7 @@ diff --git a/util.c b/util.c extern int module_id; extern int modify_window; extern int relative_paths; -@@ -272,6 +273,10 @@ int copy_file(const char *source, const char *dest, int ofd, +@@ -273,6 +274,10 @@ int copy_file(const char *source, const char *dest, int ofd, int ifd; char buf[1024 * 8]; int len; /* Number of bytes read into `buf'. */ @@ -235,7 +235,7 @@ diff --git a/util.c b/util.c if ((ifd = do_open(source, O_RDONLY, 0)) < 0) { rsyserr(FERROR_XFER, errno, "open %s", full_fname(source)); -@@ -293,7 +298,27 @@ int copy_file(const char *source, const char *dest, int ofd, +@@ -294,7 +299,27 @@ int copy_file(const char *source, const char *dest, int ofd, } } @@ -263,7 +263,7 @@ diff --git a/util.c b/util.c if (full_write(ofd, buf, len) < 0) { rsyserr(FERROR_XFER, errno, "write %s", full_fname(dest)); close(ifd); -@@ -314,6 +339,16 @@ int copy_file(const char *source, const char *dest, int ofd, +@@ -315,6 +340,16 @@ int copy_file(const char *source, const char *dest, int ofd, full_fname(source)); }