1 Index: src/filed/accurate.c
2 ===================================================================
3 --- src/filed/accurate.c (revision 7619)
4 +++ src/filed/accurate.c (working copy)
8 typedef struct PrivateCurFile {
17 -static int my_cmp(void *item1, void *item2)
19 - CurFile *elt1, *elt2;
20 - elt1 = (CurFile *) item1;
21 - elt2 = (CurFile *) item2;
22 - return strcmp(elt1->fname, elt2->fname);
25 static bool accurate_mark_file_as_seen(JCR *jcr, CurFile *elt)
27 /* TODO: just use elt->seen = 1 */
28 - CurFile *temp = (CurFile *)jcr->file_list->search(elt, my_cmp);
29 + CurFile *temp = (CurFile *)jcr->file_list->lookup(elt->fname);
31 temp->seen = 1; /* records are in memory */
38 - search.fname = fname;
39 - CurFile *temp = (CurFile *)jcr->file_list->search(&search, my_cmp);
40 + CurFile *temp = (CurFile *)jcr->file_list->lookup(fname);
42 memcpy(ret, temp, sizeof(CurFile));
45 static bool accurate_init(JCR *jcr, int nbfile)
48 - jcr->file_list = New(rblist(elt, &elt->link));
49 + jcr->file_list = (htable *)malloc(sizeof(htable));
50 + jcr->file_list->init(elt, &elt->link, nbfile);
55 ff_pkt = init_find_files();
56 ff_pkt->type = FT_DELETED;
58 - foreach_rblist(elt, jcr->file_list) {
59 + foreach_htable(elt, jcr->file_list) {
60 if (!elt->seen) { /* already seen */
61 // Dmsg2(dbglvl, "deleted fname=%s seen=%i\n", elt->fname, elt->seen);
62 ff_pkt->fname = elt->fname;
65 /* TODO: clean htable when this function is not reached ? */
67 - delete jcr->file_list;
68 + jcr->file_list->destroy();
69 + free(jcr->file_list);
70 jcr->file_list = NULL;
76 /* we store CurFile, fname and ctime/mtime in the same chunk */
77 - item = (CurFile *)malloc(sizeof(CurFile)+strlen(fname)+1);
78 + item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+strlen(fname)+1);
79 memcpy(item, &elt, sizeof(CurFile));
80 item->fname = (char *)item+sizeof(CurFile);
81 strcpy(item->fname, fname);
82 - jcr->file_list->insert(item, my_cmp);
83 + jcr->file_list->insert(item->fname, item);
85 // Dmsg2(dbglvl, "add fname=<%s> lstat=%s\n", fname, lstat);
88 ===================================================================
89 --- src/jcr.h (revision 7619)
90 +++ src/jcr.h (working copy)
92 CRYPTO_CTX crypto; /* Crypto ctx */
93 DIRRES* director; /* Director resource */
94 bool VSS; /* VSS used by FD */
95 - rblist *file_list; /* Previous file list (accurate mode) */
96 + htable *file_list; /* Previous file list (accurate mode) */
97 #endif /* FILE_DAEMON */