incremental scan: build delete index. only load from main & original.

This commit is contained in:
Yatao Li
2022-01-19 10:37:43 +08:00
parent cf56bdfb74
commit 7d40b9e959
6 changed files with 109 additions and 39 deletions

View File

@@ -80,7 +80,8 @@ void parse(void *arg) {
int inc_ts = incremental_get(ScanCtx.original_table, doc->path_md5);
if (inc_ts != 0 && inc_ts == job->vfile.info.st_mtim.tv_sec) {
pthread_mutex_lock(&ScanCtx.copy_table_mu);
incremental_mark_file_for_copy(ScanCtx.copy_table, doc->path_md5);
incremental_mark_file(ScanCtx.copy_table, doc->path_md5);
incremental_mark_file(ScanCtx.new_table, doc->path_md5);
pthread_mutex_unlock(&ScanCtx.copy_table_mu);
pthread_mutex_lock(&ScanCtx.dbg_file_counts_mu);
@@ -89,6 +90,9 @@ void parse(void *arg) {
return;
}
pthread_mutex_lock(&ScanCtx.copy_table_mu);
incremental_mark_file(ScanCtx.new_table, doc->path_md5);
pthread_mutex_unlock(&ScanCtx.copy_table_mu);
char *buf[MAGIC_BUF_SIZE];