aboutsummaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-16 19:52:42 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 22:44:39 +0200
commitb45850388ea5505f4fd50cd659abe2f02aeca0b5 (patch)
tree994f878caf990d1569831762f0b0f4d787ab9839 /tar
parent1a95478b8d340c8b6b9dbff4f38f9293388fd1a3 (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 'tar')
-rw-r--r--tar/tar2sqfs.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c
index f774c9d..36f8cd6 100644
--- a/tar/tar2sqfs.c
+++ b/tar/tar2sqfs.c
@@ -199,20 +199,20 @@ fail_arg:
}
static int write_file(tar_header_decoded_t *hdr, file_info_t *fi,
- data_writer_t *data, file_info_t *list)
+ data_writer_t *data)
{
int ret;
if (hdr->sparse != NULL) {
ret = write_data_from_fd_condensed(data, fi, STDIN_FILENO,
- hdr->sparse, 0, list);
+ hdr->sparse, 0);
if (ret)
return -1;
return skip_padding(STDIN_FILENO, hdr->record_size);
}
- if (write_data_from_fd(data, fi, STDIN_FILENO, 0, list))
+ if (write_data_from_fd(data, fi, STDIN_FILENO, 0))
return -1;
return skip_padding(STDIN_FILENO, fi->size);
@@ -265,11 +265,8 @@ static int create_node_and_repack_data(tar_header_decoded_t *hdr, fstree_t *fs,
}
if (S_ISREG(hdr->sb.st_mode)) {
- if (write_file(hdr, node->data.file, data, fs->files))
+ if (write_file(hdr, node->data.file, data))
return -1;
-
- node->data.file->next = fs->files;
- fs->files = node->data.file;
}
return 0;