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

Function flist_free

flist.c:2980–3012  ·  view source on GitHub ↗

Free up all elements in a flist. */

Source from the content-addressed store, hash-verified

2978
2979/* Free up all elements in a flist. */
2980void flist_free(struct file_list *flist)
2981{
2982 if (!flist->prev) {
2983 /* Was FLIST_TEMP dir-list. */
2984 } else if (flist == flist->prev) {
2985 first_flist = cur_flist = NULL;
2986 file_total = 0;
2987 flist_cnt = 0;
2988 } else {
2989 if (flist == cur_flist)
2990 cur_flist = flist->next;
2991 if (flist == first_flist)
2992 first_flist = first_flist->next;
2993 else {
2994 flist->prev->next = flist->next;
2995 if (!flist->next)
2996 flist->next = first_flist;
2997 }
2998 flist->next->prev = flist->prev;
2999 file_total -= flist->used;
3000 flist_cnt--;
3001 }
3002
3003 if (!flist->prev || !flist_cnt)
3004 pool_destroy(flist->file_pool);
3005 else
3006 pool_free_old(flist->file_pool, flist->pool_boundary);
3007
3008 if (flist->sorted && flist->sorted != flist->files)
3009 free(flist->sorted);
3010 free(flist->files);
3011 free(flist);
3012}
3013
3014/* This routine ensures we don't have any duplicate names in our file list.
3015 * duplicate names can cause corruption because of the pipelining. */

Callers 6

send_filesFunction · 0.85
delete_in_dirFunction · 0.85
recv_generatorFunction · 0.85
check_for_finished_filesFunction · 0.85
delete_dir_contentsFunction · 0.85
recv_filesFunction · 0.85

Calls 2

pool_destroyFunction · 0.85
pool_free_oldFunction · 0.85

Tested by

no test coverage detected