The code can now omit requesting that the sender supply an abbreviated
[rsync/rsync-patches.git] / preallocate.diff
index 39ad416..8d1f423 100644 (file)
@@ -11,7 +11,7 @@ To use this patch, run these commands for a successful build:
 
 --- old/configure.in
 +++ new/configure.in
 
 --- old/configure.in
 +++ new/configure.in
-@@ -555,7 +555,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
+@@ -560,7 +560,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 \
      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 \
@@ -30,15 +30,15 @@ To use this patch, run these commands for a successful build:
  int do_compression = 0;
  int def_compress_level = Z_DEFAULT_COMPRESSION;
  int am_root = 0;
  int do_compression = 0;
  int def_compress_level = Z_DEFAULT_COMPRESSION;
  int am_root = 0;
-@@ -201,6 +202,7 @@ static void print_rsync_version(enum log
-       char const *hardlinks = "no ";
+@@ -202,6 +203,7 @@ static void print_rsync_version(enum log
+       char const *acls = "no ";
        char const *links = "no ";
        char const *ipv6 = "no ";
 +      char const *preallocation = "no ";
        STRUCT_STAT *dumstat;
  
  #ifdef HAVE_SOCKETPAIR
        char const *links = "no ";
        char const *ipv6 = "no ";
 +      char const *preallocation = "no ";
        STRUCT_STAT *dumstat;
  
  #ifdef HAVE_SOCKETPAIR
-@@ -223,6 +225,10 @@ static void print_rsync_version(enum log
+@@ -228,6 +230,10 @@ static void print_rsync_version(enum log
        ipv6 = "";
  #endif
  
        ipv6 = "";
  #endif
  
@@ -48,19 +48,19 @@ To use this patch, run these commands for a successful build:
 +
        rprintf(f, "%s  version %s  protocol version %d\n",
                RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
 +
        rprintf(f, "%s  version %s  protocol version %d\n",
                RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
-       rprintf(f, "Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -233,8 +239,8 @@ static void print_rsync_version(enum log
+       rprintf(f, "Copyright (C) 1996-2007 by Andrew Tridgell, Wayne Davison, and others.\n");
+@@ -238,8 +244,8 @@ static void print_rsync_version(enum log
                (int)(sizeof (int64) * 8));
        rprintf(f, "    %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
                got_socketpair, hardlinks, links, ipv6, have_inplace);
                (int)(sizeof (int64) * 8));
        rprintf(f, "    %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
                got_socketpair, hardlinks, links, ipv6, have_inplace);
--      rprintf(f, "    %sappend\n",
--              have_inplace);
-+      rprintf(f, "    %sappend, %spreallocation\n",
-+              have_inplace, preallocation);
+-      rprintf(f, "    %sappend, %sACLs\n",
+-              have_inplace, acls);
++      rprintf(f, "    %sappend, %sACLs, %spreallocation\n",
++              have_inplace, acls, preallocation);
  
  #ifdef MAINTAINER_MODE
        rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
  
  #ifdef MAINTAINER_MODE
        rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -311,6 +317,9 @@ void usage(enum logcode F)
+@@ -319,6 +325,9 @@ void usage(enum logcode F)
    rprintf(F," -O, --omit-dir-times        omit directories when preserving times\n");
    rprintf(F,"     --super                 receiver attempts super-user activities\n");
    rprintf(F," -S, --sparse                handle sparse files efficiently\n");
    rprintf(F," -O, --omit-dir-times        omit directories when preserving times\n");
    rprintf(F,"     --super                 receiver attempts super-user activities\n");
    rprintf(F," -S, --sparse                handle sparse files efficiently\n");
@@ -70,7 +70,7 @@ To use this patch, run these commands for a successful build:
    rprintf(F," -n, --dry-run               show what would have been transferred\n");
    rprintf(F," -W, --whole-file            copy files whole (without rsync algorithm)\n");
    rprintf(F," -x, --one-file-system       don't cross filesystem boundaries\n");
    rprintf(F," -n, --dry-run               show what would have been transferred\n");
    rprintf(F," -W, --whole-file            copy files whole (without rsync algorithm)\n");
    rprintf(F," -x, --one-file-system       don't cross filesystem boundaries\n");
-@@ -468,6 +477,7 @@ static struct poptOption long_options[] 
+@@ -479,6 +488,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 },
    {"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 },
@@ -78,7 +78,7 @@ To use this patch, run these commands for a successful build:
    {"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 },
    {"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 },
-@@ -1132,6 +1142,15 @@ int parse_arguments(int *argc, const cha
+@@ -1161,6 +1171,15 @@ int parse_arguments(int *argc, const cha
        }
  #endif
  
        }
  #endif
  
@@ -94,7 +94,7 @@ To use this patch, run these commands for a successful build:
        if (write_batch && read_batch) {
                snprintf(err_buf, sizeof err_buf,
                        "--write-batch and --read-batch can not be used together\n");
        if (write_batch && read_batch) {
                snprintf(err_buf, sizeof err_buf,
                        "--write-batch and --read-batch can not be used together\n");
-@@ -1779,6 +1798,9 @@ void server_options(char **args,int *arg
+@@ -1808,6 +1827,9 @@ void server_options(char **args,int *arg
        else if (remove_source_files)
                args[ac++] = "--remove-sent-files";
  
        else if (remove_source_files)
                args[ac++] = "--remove-sent-files";
  
@@ -106,7 +106,7 @@ To use this patch, run these commands for a successful build:
  
 --- old/receiver.c
 +++ new/receiver.c
  
 --- old/receiver.c
 +++ new/receiver.c
-@@ -44,6 +44,7 @@ extern int cleanup_got_literal;
+@@ -43,6 +43,7 @@ extern int cleanup_got_literal;
  extern int remove_source_files;
  extern int append_mode;
  extern int sparse_files;
  extern int remove_source_files;
  extern int append_mode;
  extern int sparse_files;
@@ -114,7 +114,7 @@ To use this patch, run these commands for a successful build:
  extern int keep_partial;
  extern int checksum_seed;
  extern int inplace;
  extern int keep_partial;
  extern int checksum_seed;
  extern int inplace;
-@@ -137,6 +138,19 @@ static int receive_data(int f_in, char *
+@@ -136,6 +137,19 @@ static int receive_data(int f_in, char *
        int32 i;
        char *map = NULL;
  
        int32 i;
        char *map = NULL;
  
@@ -134,7 +134,7 @@ To use this patch, run these commands for a successful build:
        read_sum_head(f_in, &sum);
  
        if (fd_r >= 0 && size_r > 0) {
        read_sum_head(f_in, &sum);
  
        if (fd_r >= 0 && size_r > 0) {
-@@ -244,8 +258,18 @@ static int receive_data(int f_in, char *
+@@ -243,8 +257,18 @@ static int receive_data(int f_in, char *
                goto report_write_error;
  
  #ifdef HAVE_FTRUNCATE
                goto report_write_error;
  
  #ifdef HAVE_FTRUNCATE
@@ -157,8 +157,8 @@ To use this patch, run these commands for a successful build:
        if (do_progress)
 --- old/rsync.h
 +++ new/rsync.h
        if (do_progress)
 --- old/rsync.h
 +++ new/rsync.h
-@@ -546,6 +546,10 @@ struct idev_node {
- #define IN_LOOPBACKNET 127
+@@ -551,6 +551,10 @@ struct idev_node {
+ #define ACLS_NEED_MASK 1
  #endif
  
 +#if defined HAVE_FTRUNCATE && defined HAVE_POSIX_FALLOCATE
  #endif
  
 +#if defined HAVE_FTRUNCATE && defined HAVE_POSIX_FALLOCATE
@@ -170,7 +170,7 @@ To use this patch, run these commands for a successful build:
  union file_extras {
 --- old/rsync.yo
 +++ new/rsync.yo
  union file_extras {
 --- old/rsync.yo
 +++ new/rsync.yo
-@@ -332,6 +332,7 @@ to the detailed description below for a 
+@@ -333,6 +333,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
   -O, --omit-dir-times        omit directories when preserving times
       --super                 receiver attempts super-user activities
   -S, --sparse                handle sparse files efficiently
@@ -178,7 +178,7 @@ To use this patch, run these commands for a successful build:
   -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
   -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
+@@ -914,6 +915,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.
  
  filesystem. It doesn't seem to handle seeks over null regions
  correctly and ends up corrupting the files.
  
@@ -200,7 +200,7 @@ To use this patch, run these commands for a successful build:
  
 --- old/t_stub.c
 +++ new/t_stub.c
  
 --- old/t_stub.c
 +++ new/t_stub.c
-@@ -23,6 +23,7 @@
+@@ -22,6 +22,7 @@
  #include "rsync.h"
  
  int modify_window = 0;
  #include "rsync.h"
  
  int modify_window = 0;
@@ -210,7 +210,7 @@ To use this patch, run these commands for a successful build:
  int human_readable = 0;
 --- old/util.c
 +++ new/util.c
  int human_readable = 0;
 --- old/util.c
 +++ new/util.c
-@@ -25,6 +25,7 @@
+@@ -24,6 +24,7 @@
  
  extern int verbose;
  extern int dry_run;
  
  extern int verbose;
  extern int dry_run;
@@ -218,7 +218,7 @@ To use this patch, run these commands for a successful build:
  extern int module_id;
  extern int modify_window;
  extern int relative_paths;
  extern int module_id;
  extern int modify_window;
  extern int relative_paths;
-@@ -270,6 +271,10 @@ int copy_file(const char *source, const 
+@@ -269,6 +270,10 @@ int copy_file(const char *source, const 
        int ofd;
        char buf[1024 * 8];
        int len;   /* Number of bytes read into `buf'. */
        int ofd;
        char buf[1024 * 8];
        int len;   /* Number of bytes read into `buf'. */
@@ -229,7 +229,7 @@ To use this patch, run these commands for a successful build:
  
        ifd = do_open(source, O_RDONLY, 0);
        if (ifd == -1) {
  
        ifd = do_open(source, O_RDONLY, 0);
        if (ifd == -1) {
-@@ -289,7 +294,27 @@ int copy_file(const char *source, const 
+@@ -288,7 +293,27 @@ int copy_file(const char *source, const 
                return -1;
        }
  
                return -1;
        }
  
@@ -257,7 +257,7 @@ To use this patch, run these commands for a successful build:
                if (full_write(ofd, buf, len) < 0) {
                        rsyserr(FERROR, errno, "write %s", full_fname(dest));
                        close(ifd);
                if (full_write(ofd, buf, len) < 0) {
                        rsyserr(FERROR, errno, "write %s", full_fname(dest));
                        close(ifd);
-@@ -310,6 +335,16 @@ int copy_file(const char *source, const 
+@@ -309,6 +334,16 @@ int copy_file(const char *source, const 
                        full_fname(source));
        }
  
                        full_fname(source));
        }