diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-16 19:52:42 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-18 22:44:39 +0200 |
commit | b45850388ea5505f4fd50cd659abe2f02aeca0b5 (patch) | |
tree | 994f878caf990d1569831762f0b0f4d787ab9839 /include/data_writer.h | |
parent | 1a95478b8d340c8b6b9dbff4f38f9293388fd1a3 (diff) |
cleanup: internalize deduplication list in data_writer
This change removes the need for passing a list of files around for
deduplication. Also the deduplication code no longer needs to worry
about order, since the file being deduplicated is only added after
deduplication is done.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/data_writer.h')
-rw-r--r-- | include/data_writer.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/include/data_writer.h b/include/data_writer.h index dc63592..f384ce7 100644 --- a/include/data_writer.h +++ b/include/data_writer.h @@ -69,32 +69,25 @@ int data_writer_flush_fragments(data_writer_t *data); Blocks or fragments that are all zero bytes automatically detected, not written out and the sparse file accounting updated accordingly. - The flags argument is a combination of DW_* flags. - - If 'list' is not NULL, it is used for fragment and data block deduplication. - It is assumed that the list is processed in order and scanning stops as soon - as the current file info 'fi' is encountered in the list. + The flags argument is a combination of DW_* flags. After completion the + data writer collects the 'fi' in an internal list it uses for deduplication. Returns 0 on success, prints errors to stderr. */ int write_data_from_fd(data_writer_t *data, file_info_t *fi, int infd, - int flags, file_info_t *list); + int flags); /* Does the same as write_data_from_fd but the input file is the condensed representation of a sparse file. The layout must be in order and non-overlapping. - The flags argument is a combination of DW_* flags. - - If 'list' is not NULL, it is used for fragment and data block deduplication. - It is assumed that the list is processed in order and scanning stops as soon - as the current file info 'fi' is encountered in the list. + The flags argument is a combination of DW_* flags. After completion the + data writer collects the 'fi' in an internal list it uses for deduplication. Returns 0 on success, prints errors to stderr. */ int write_data_from_fd_condensed(data_writer_t *data, file_info_t *fi, - int infd, sparse_map_t *map, int flags, - file_info_t *list); + int infd, sparse_map_t *map, int flags); #endif /* DATA_WRITER_H */ |