MCPcopy Index your code
hub / github.com/RsyncProject/rsync / idev_find

Function idev_find

hlink.c:67–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67struct ht_int64_node *idev_find(int64 dev, int64 ino)
68{
69 static struct ht_int64_node *dev_node = NULL;
70
71 /* Note that some OSes have a dev == 0, so increment to avoid storing a 0. */
72 if (!dev_node || dev_node->key != dev+1) {
73 /* We keep a separate hash table of inodes for every device. */
74 dev_node = hashtable_find(dev_tbl, dev+1, data_when_new);
75 if (dev_node->data == data_when_new) {
76 dev_node->data = hashtable_create(512, HT_KEY64);
77 if (DEBUG_GTE(HLINK, 3)) {
78 rprintf(FINFO, "[%s] created hashtable for dev %s\n",
79 who_am_i(), big_num(dev));
80 }
81 }
82 }
83
84 return hashtable_find(dev_node->data, ino, (void*)-1L);
85}
86
87void idev_destroy(void)
88{

Callers 2

send_file_entryFunction · 0.85
recv_file_entryFunction · 0.85

Calls 5

hashtable_findFunction · 0.85
hashtable_createFunction · 0.85
big_numFunction · 0.85
rprintfFunction · 0.70
who_am_iFunction · 0.70

Tested by

no test coverage detected