MCPcopy Create free account
hub / github.com/RsyncProject/rsync / match_hard_links

Function match_hard_links

hlink.c:186–208  ·  view source on GitHub ↗

Analyze the hard-links in the file-list by creating a list of all the * items that have hlink data, sorting them, and matching up identical * values into clusters. These will be a single linked list from last * to first when we're done. */

Source from the content-addressed store, hash-verified

184 * values into clusters. These will be a single linked list from last
185 * to first when we're done. */
186void match_hard_links(struct file_list *flist)
187{
188 if (!list_only && flist->used) {
189 int i, ndx_count = 0;
190 int32 *ndx_list;
191
192 ndx_list = new_array(int32, flist->used);
193
194 for (i = 0; i < flist->used; i++) {
195 if (F_IS_HLINKED(flist->sorted[i]))
196 ndx_list[ndx_count++] = i;
197 }
198
199 hlink_flist = flist;
200
201 if (ndx_count)
202 match_gnums(ndx_list, ndx_count);
203
204 free(ndx_list);
205 }
206 if (protocol_version < 30)
207 idev_destroy();
208}
209
210static int maybe_hard_link(struct file_struct *file, int ndx,
211 char *fname, int statret, stat_x *sxp,

Callers 2

wait_for_receiverFunction · 0.85
do_recvFunction · 0.85

Calls 2

match_gnumsFunction · 0.85
idev_destroyFunction · 0.85

Tested by

no test coverage detected