- jcr->file_list = tchdbnew();
- tchdbsetcache(jcr->file_list, 300000);
- tchdbtune(jcr->file_list,
- nbfile, /* nb bucket 0.5n to 4n */
- 6, /* size of element 2^x */
- 16,
- 0); /* options like compression */
-
- POOLMEM *name = get_pool_memory(PM_MESSAGE);
- make_unique_filename(name, jcr->JobId, "accurate");
-
- if(!tchdbopen(jcr->file_list, name, HDBOWRITER | HDBOCREAT)){
- Jmsg(jcr, M_ERROR, 1, _("Can't open accurate hash disk ERR=%s\n"),
- tchdberrmsg(tchdbecode(jcr->file_list)));
+ jcr->file_list = tcadbnew();
+//
+// tchdbsetcache(jcr->file_list, 300000);
+// tchdbtune(jcr->file_list,
+// nbfile, /* nb bucket 0.5n to 4n */
+// 6, /* size of element 2^x */
+// 16,
+// 0); /* options like compression */
+//
+ jcr->hash_name = get_pool_memory(PM_MESSAGE);
+ POOLMEM *temp = get_pool_memory(PM_MESSAGE);
+
+ if (nbfile > 500000) {
+ make_unique_filename(&jcr->hash_name, jcr->JobId, "accurate");
+ pm_strcat(jcr->hash_name, ".tcb");
+ Mmsg(temp, "%s#bnum=%i#mode=e#opts=l",
+ jcr->hash_name, nbfile*4);
+ Dmsg1(dbglvl, "Doing accurate hash on disk %s\n", jcr->hash_name);
+ } else {
+ Dmsg0(dbglvl, "Doing accurate hash on memory\n");
+ pm_strcpy(jcr->hash_name, "*");
+ pm_strcpy(temp, "*");
+ }
+
+ if(!tcadbopen(jcr->file_list, jcr->hash_name)){
+ Jmsg(jcr, M_ERROR, 1, _("Can't open accurate hash disk\n"));