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

Function uncache_tmp_xattrs

xattrs.c:897–942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897void uncache_tmp_xattrs(void)
898{
899 if (prior_xattr_count != (size_t)-1) {
900 rsync_xa_list *xa_list_item = rsync_xal_l.items;
901 rsync_xa_list *xa_list_start = xa_list_item + prior_xattr_count;
902 xa_list_item += rsync_xal_l.count;
903 rsync_xal_l.count = prior_xattr_count;
904 while (xa_list_item-- > xa_list_start) {
905 struct ht_int64_node *node;
906 rsync_xa_list_ref *ref;
907
908 rsync_xal_free(&xa_list_item->xa_items);
909
910 if (rsync_xal_h == NULL)
911 continue;
912
913 node = hashtable_find(rsync_xal_h, xa_list_item->key, NULL);
914 if (node == NULL)
915 continue;
916
917 if (node->data == NULL)
918 continue;
919
920 ref = node->data;
921 if (xa_list_item->ndx == ref->ndx) {
922 /* xa_list_item is the first in the list. */
923 node->data = ref->next;
924 free(ref);
925 continue;
926 }
927
928 while (1) {
929 rsync_xa_list_ref *next = ref->next;
930 if (next == NULL)
931 break;
932 if (xa_list_item->ndx == next->ndx) {
933 ref->next = next->next;
934 free(next);
935 break;
936 }
937 ref = next;
938 }
939 }
940 prior_xattr_count = (size_t)-1;
941 }
942}
943
944static int rsync_xal_set(const char *fname, item_list *xalp,
945 const char *fnamecmp, stat_x *sxp)

Callers 2

copy_valid_pathFunction · 0.85
make_backupFunction · 0.85

Calls 2

rsync_xal_freeFunction · 0.85
hashtable_findFunction · 0.85

Tested by

no test coverage detected