Fixes hard-links exclusion after the first one.

This commit is contained in:
Andrea Mazzoleni 2012-08-19 17:07:56 +02:00
parent e449777417
commit cdba43dea6
2 changed files with 7 additions and 4 deletions

10
scan.c
View file

@ -137,9 +137,7 @@ static void scan_file_insert(struct snapraid_state* state, struct snapraid_disk*
disk->first_free_block = block_pos + 1;
}
/* insert the file in the file containers */
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
/* note that the file is already added in the file hashtables */
tommy_list_insert_tail(&disk->filelist, &file->nodelist, file);
}
@ -322,7 +320,11 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state,
/* mark it as present */
file_flag_set(file, FILE_IS_PRESENT);
/* insert it in the delayed insert list */
/* insert the file in the file hashtables, to allow to find duplicate hardlinks */
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
/* insert the file in the delayed block allocation */
tommy_list_insert_tail(&scan->file_insert_list, &file->nodelist, file);
}