From f439b20706ade4b5630c3d6c57e6a36ce0dc287a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 30 Jun 2019 16:41:21 +0200 Subject: Add support for repacking condensed sparse files This commit broadly does the following things: - Rename and move the sparse mapping structure to libutil - Add a function to the data writer for writing condensed versions of sparse files, given the mapping. - This shares code with the already existing function for regular files. The shared code is moved to a common helper function. - Add support to tar2sqfs for repacking sparse files. Signed-off-by: David Oberhollenzer --- lib/tar/read_header.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/tar/read_header.c') diff --git a/lib/tar/read_header.c b/lib/tar/read_header.c index 5d2a808..74666b3 100644 --- a/lib/tar/read_header.c +++ b/lib/tar/read_header.c @@ -451,9 +451,9 @@ fail: return NULL; } -static void free_sparse_list(tar_sparse_data_t *sparse) +static void free_sparse_list(sparse_map_t *sparse) { - tar_sparse_data_t *old; + sparse_map_t *old; while (sparse != NULL) { old = sparse; @@ -462,9 +462,9 @@ static void free_sparse_list(tar_sparse_data_t *sparse) } } -static tar_sparse_data_t *read_gnu_old_sparse(int fd, tar_header_t *hdr) +static sparse_map_t *read_gnu_old_sparse(int fd, tar_header_t *hdr) { - tar_sparse_data_t *list = NULL, *end = NULL, *node; + sparse_map_t *list = NULL, *end = NULL, *node; gnu_sparse_t sph; uint64_t off, sz; ssize_t ret; -- cgit v1.2.3