Commit Graph

57 Commits

Author SHA1 Message Date
Wayne Davison
6cbde57d88 Call f_name() with revised args (which also replaces f_name_to()). 2006-01-14 20:26:23 +00:00
Wayne Davison
45c49b52a4 Got rid of calls to (the soon to vanish) safe_fname() function. 2006-01-13 21:17:09 +00:00
Wayne Davison
541b23d144 When compare-dest/link-dest/copy-dest are in effect, we now check
if the file we're about to hard-link to the leader is present in
one of the dest dirs -- if it is, we adjust the text we output
accordingly.
2005-12-15 23:00:02 +00:00
Wayne Davison
8cd3db27b6 There is no longer a need to check file->link_u.links at the start
of hard_link_check() (because the caller has already checked it).
2005-07-31 23:19:42 +00:00
Wayne Davison
a45f581b2a - Never output the '"FOO" is a hard link' message when -i (%i)
output is enabled.
- Go back to outputting '"FOO" is a hard link' message when -i (%i)
  is not enabled and verbose > 1.
2005-06-09 21:56:11 +00:00
Wayne Davison
3cd5301f40 - Added a new function, maybe_hard_link(), which now holds the code
(moved from hard_link_cluster()) that checks the inode/dev of an
  existing file and either does nothing (when properly linked), or
  removes the existing file before calling hard_link_one().
- Changed hard_link_check() so that it checks if the master item is
  marked with FINISHED_LINK (in its hlindex int), and if so, it
  finishes the current file by calling maybe_hard_link() (and
  marking it as finished too).  Otherwise it marks the item as
  skipped by setting hlindex to SKIPPED_LINK.
- Fixed the outputting of an error in hard_link_one() so that the
  message is always output when the caller did not request "terse"
  processing.
- Changed hard_link_cluster() so that it marks the master item with
  FINISHED_LINK and then links only the skipped items (marking them
  with FINISHED_LINK too).
2005-04-23 17:48:34 +00:00
Wayne Davison
97e786c331 - Fixed a potential crash/infinite-loop bug if -H was used
when sending a single file.
- Made a couple variable improvements in link_idev_data().
- Got rid of the non-NULL check of hlink_list in init_hard_links()
  because is enough to just check file->link_u.links these days.
2005-04-15 08:26:58 +00:00
Wayne Davison
b7d4d28bb3 When itemizing, we now set ITEM_LOCAL_CHANGE and ITEM_XNAME_FOLLOWS. 2005-03-09 18:54:06 +00:00
Wayne Davison
9f2e3c3f52 - Changed hlink_list[] to store file-list indexes instead of
pointers.
- Made hard_link_one() non-static so that the generator can call it.
  Improved it to do itemized output.
- Replaced do_hard_links() with hard_link_cluster(), which changes
  the hard-linking from a post-transfer loop into a per-cluster
  operation that occurs incrementally as the transfer updates (or
  finds unchanged) one item in the cluster.
2005-03-05 00:21:44 +00:00
Wayne Davison
0f80c3e886 Added 2 args to do_hard_links() so that it can call maybe_send_keepalive(). 2005-02-27 09:02:29 +00:00
Wayne Davison
4f5b0756df John E. Malmberg convinced me to standardize on #ifs for defined
values instead of non-zero.
2005-02-14 00:53:43 +00:00
Wayne Davison
122d1771db Improved the call to f_name_cmp(). 2005-02-13 20:06:18 +00:00
Wayne Davison
1dca857b5b Fixed a typo. 2005-02-07 20:46:42 +00:00
Wayne Davison
71903f601a Added missing calls to safe_fname() and full_fname(). 2005-02-07 20:40:18 +00:00
Wayne Davison
8982a89b24 In hlink_compare(), call f_name_cmp() directly instead of using
file_compare().
2005-02-03 01:19:03 +00:00
Wayne Davison
bb91a624f1 Made hard_link_check() compile when SUPPORT_HARD_LINKS isn't enabled. 2004-07-12 07:03:28 +00:00
Wayne Davison
373ef16010 Call link_stat() with its new arg (for --keep-dirlinks support). 2004-06-11 07:40:45 +00:00
Wayne Davison
d62bcc17f3 Changed rprintf() calls that included strerror() to use rsyserr(). 2004-05-15 19:31:10 +00:00
Wayne Davison
028fdddb49 Fixed a crash bug when hlink_list is NULL and a link_u.links
pointer in one of the file_struct nodes is not.
2004-03-26 16:46:20 +00:00
Wayne Davison
417c99f637 If --backup was specified, the links we remove are backed up. 2004-02-11 05:03:04 +00:00
J.W. Schultz
9935066b70 Make idev, hlink and file_struct + strings use allocation
pools.
2004-02-10 03:23:37 +00:00
J.W. Schultz
0d6e308b51 correct sizeof usage. 2004-02-03 06:21:56 +00:00
Wayne Davison
67f3feebcb Don't free link_u.idev. 2004-02-02 21:32:52 +00:00
Wayne Davison
c6edb381f5 Free the hlink data again. 2004-02-02 07:06:50 +00:00
Wayne Davison
13c5b46361 Don't free the hlink data (it is not separately allocated anymore). 2004-02-02 05:06:35 +00:00
Wayne Davison
904817552d Fixed a comment. 2004-01-27 07:48:57 +00:00
Wayne Davison
d38fc30563 We now link the hard-linked flist entries into a circular list, mark
the last item with FLAG_HLINK_EOL, and save off an index for our
master entry in the hlink_list[] array.  Added the hard_link_check()
function.
2004-01-25 22:32:10 +00:00
Wayne Davison
3fef53645d Use the new f_name_to() calling syntax. 2004-01-22 04:38:18 +00:00
Wayne Davison
1d5cda2265 Updated to perform a much more efficient hlink algorithm that doesn't
require any binary searching of hlink data.
2004-01-12 03:49:47 +00:00
Wayne Davison
cb7fb45e42 Updated a questioning comment. 2004-01-11 08:17:19 +00:00
Wayne Davison
92cc9dd7c2 Use the new dev+inode union in the flist_struct. 2004-01-11 07:56:14 +00:00
Wayne Davison
c4b4df4fb4 Optimized the sending of dev+inode data for hard-linking support
(but only when speaking protocol 28).
2004-01-08 11:29:50 +00:00
Wayne Davison
6aae748ea7 - No need to check S_ISREG() on files already in the hlink_list.
- The realloc in init_hard_links() might fail if the list is empty
  (which can happen if there are no regular files in the transfer).
  I changed the code to free the list in that case.
2004-01-08 03:17:07 +00:00
J.W. Schultz
11dc274054 Change hlink_list so we only have a list of pointers to
file_struct instead of a copy of the file_struct list.
2004-01-07 09:06:37 +00:00
Wayne Davison
310c9f30f0 Optimized hard_link_one() to not call f_name() so many times. 2004-01-02 07:34:49 +00:00
Wayne Davison
58cadc8608 Merged in the security fixes from 2.5.7. 2003-12-06 21:07:27 +00:00
Martin Pool
527a51cec5 Doc 2002-03-25 07:07:03 +00:00
Martin Pool
20c15aead5 Hm, strange off-by-one bug. 2002-03-25 06:59:17 +00:00
Martin Pool
4f2dcb1714 If we discover a hardlink with -vv say what it's a link to. 2002-03-25 06:27:44 +00:00
Martin Pool
fae5bb3183 Doc.
do_hard_links() actually only looks at the global hardlink table, so
it can be a (void) fn.  (Another gcc warning...)
2002-01-23 07:42:30 +00:00
Martin Pool
6e69cff118 Autoindent
Add copyright
2002-01-11 07:11:43 +00:00
David Dykstra
c7c11a0d4c When a file cannot be deleted because of ETXTBSY (in particular, when an
executable is busy on HPUX), rename it instead to .rsyncNNN.  Most of
the code was submitted by Ketil Kristiansen <ketil-k@osc.no>
1999-03-11 22:17:42 +00:00
Andrew Tridgell
f578043391 for consistency use memcpy/memset everywhere instead of bcopy/bzero 1998-06-18 09:51:44 +00:00
Andrew Tridgell
9486289ce4 some large systematic changes to make socket conversion easier. The
biggest one is the use of rprintf() instead of fprintf()
1998-05-07 14:50:22 +00:00
Andrew Tridgell
bcacc18bdf added support for 64 bit file offsets under Solaris 2.6. Not tested
yet.
1998-05-06 05:43:36 +00:00
Andrew Tridgell
a16bbc3990 a few code cleanups 1998-04-13 07:26:37 +00:00
Andrew Tridgell
dd04a03440 fixed a bug in the hlink code - it wasn't taking account of the new
pointer list code for flist.
1998-04-05 04:34:52 +00:00
Andrew Tridgell
31e125226d added wrappers around all the system calls that can change what is on
disk. The wrappers check for dry_run.
1998-03-23 13:25:30 +00:00
Andrew Tridgell
3a6a366fc5 finished 64 bit file offset support. Hopefully rsync can now transfer
files up to 2^64 bytes in size. Now I just need to find enough disk
space to test this :-)

The 64 bit offset code only works if off_t is 64 bits (or bigger!) on
both ends of the link. If one end tries to send a file greater than
2^31 in size and the other end doesn't support it then rsync will
abort.

This commit also cleans up some static declarations so they are in a
unitinitialised segment to save load time.
1998-03-23 12:52:57 +00:00
Andrew Tridgell
3ec4dd9781 a large change to make rsync much more memory efficient. This is done
in 3 ways:

1) the realloc is done on a list of pointers, not a list of structures
2) only the basename of the file is now kept in the file struct an a
   util function f_name() is now used to access the full name when
   required.
3) pointers to directory names are re-used

hopefully I haven't broken anything. This will need lots of testing.
1998-03-23 03:45:02 +00:00