From 28a5b78c6f13aeac716d4aaf4248b8d8763c9b8b Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 18 Jul 2008 17:35:22 -0700 Subject: [PATCH] Improved the hard-link logging. --- flist.c | 24 +++++++++++++----------- hlink.c | 6 +++--- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/flist.c b/flist.c index 109497d4..b3a26535 100644 --- a/flist.c +++ b/flist.c @@ -475,10 +475,15 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, xflags |= XMIT_HLINK_FIRST; } if (DEBUG_GTE(HLINK, 1)) { - rprintf(FINFO, "found %s dev:inode %s:%s (#%ld)\n", - xflags & XMIT_HLINK_FIRST ? "first" : "matching", - big_num(tmp_dev, 0), big_num(tmp_ino, 0), - (long)np->data - 1); + if (first_hlink_ndx >= 0) { + rprintf(FINFO, "[%s] #%d hard-links #%d (%sabbrev)\n", + who_am_i(), first_ndx + ndx, first_hlink_ndx, + first_hlink_ndx >= first_ndx ? "" : "un"); + } else if (DEBUG_GTE(HLINK, 3)) { + rprintf(FINFO, "[%s] dev:inode for #%d is %s:%s\n", + who_am_i(), first_ndx + ndx, + big_num(tmp_dev, 0), big_num(tmp_ino, 0)); + } } } else { if (tmp_dev == dev) { @@ -529,11 +534,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, #ifdef SUPPORT_HARD_LINKS if (first_hlink_ndx >= 0) { write_varint(f, first_hlink_ndx); - if (first_hlink_ndx >= first_ndx) { - if (DEBUG_GTE(HLINK, 2)) - rprintf(FINFO, "sending abbr. entry\n"); + if (first_hlink_ndx >= first_ndx) goto the_end; - } } #endif @@ -728,9 +730,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist, first_hlink_ndx, flist->ndx_start + flist->used); exit_cleanup(RERR_PROTOCOL); } - if (DEBUG_GTE(HLINK, 2)) { - rprintf(FINFO, "hard-link reference #%d (%sabbr.)\n", - first_hlink_ndx, + if (DEBUG_GTE(HLINK, 1)) { + rprintf(FINFO, "[%s] #%d hard-links #%d (%sabbrev)\n", + who_am_i(), flist->used+flist->ndx_start, first_hlink_ndx, first_hlink_ndx >= flist->ndx_start ? "" : "un"); } if (first_hlink_ndx >= flist->ndx_start) { diff --git a/hlink.c b/hlink.c index c5a4fef3..598743db 100644 --- a/hlink.c +++ b/hlink.c @@ -70,10 +70,10 @@ struct ht_int64_node *idev_find(int64 dev, int64 ino) dev_node = hashtable_find(dev_tbl, dev, 1); if (!(tbl = dev_node->data)) { tbl = dev_node->data = hashtable_create(512, SIZEOF_INT64 == 8); - if (DEBUG_GTE(HLINK, 1)) { + if (DEBUG_GTE(HLINK, 2)) { rprintf(FINFO, - "created inode hashtable for dev %s\n", - big_num(dev, 0)); + "[%s] created hashtable for dev %s\n", + who_am_i(), big_num(dev, 0)); } } } else -- 2.34.1