aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-11 00:46:19 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-11 00:46:19 +0200
commit2c661f100fbe6c13e7aaef2ea3c9bef546246bb2 (patch)
treec52733ef62a70a6edfa382ad637d5ec62746f014
parenta31acfdbf87a7ff6671890de9df17f9552a4f8c0 (diff)
cleanup: remove the linked list of fragment relations
Don't need that, we already know the index when we write add the fragment. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--include/fstree.h8
-rw-r--r--mkfs/block.c8
-rw-r--r--mkfs/mkfs.h1
3 files changed, 1 insertions, 16 deletions
diff --git a/include/fstree.h b/include/fstree.h
index ef2ffb1..3979503 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -55,14 +55,6 @@ struct file_info_t {
/* Path to the input file. */
char *input_file;
- /* Linked list pointer for aggregating fragments
-
- When writing out data blocks, files that don't have a multiple of
- the block size have their tail ends gathered in a fragment block.
- A linked list is used to keep track of which files share the same
- fragment block. */
- file_info_t *frag_next;
-
uint64_t size;
/* Absolute position of the first data block. */
diff --git a/mkfs/block.c b/mkfs/block.c
index fadf9b9..eba8c24 100644
--- a/mkfs/block.c
+++ b/mkfs/block.c
@@ -43,7 +43,6 @@ static int write_block(file_info_t *fi, sqfs_info_t *info)
static int flush_fragments(sqfs_info_t *info)
{
size_t newsz, size;
- file_info_t *fi;
uint64_t offset;
void *new, *ptr;
ssize_t ret;
@@ -65,9 +64,6 @@ static int flush_fragments(sqfs_info_t *info)
offset = info->super.bytes_used;
size = info->frag_offset;
- for (fi = info->frag_list; fi != NULL; fi = fi->frag_next)
- fi->fragment = info->num_fragments;
-
ret = info->cmp->do_block(info->cmp, info->fragment, size,
info->scratch, info->super.block_size);
if (ret < 0)
@@ -103,7 +99,6 @@ static int flush_fragments(sqfs_info_t *info)
info->super.bytes_used += size;
info->frag_offset = 0;
- info->frag_list = NULL;
info->super.flags &= ~SQFS_FLAG_NO_FRAGMENTS;
info->super.flags |= SQFS_FLAG_ALWAYS_FRAGMENTS;
@@ -118,8 +113,7 @@ static int add_fragment(file_info_t *fi, sqfs_info_t *info, size_t size)
}
fi->fragment_offset = info->frag_offset;
- fi->frag_next = info->frag_list;
- info->frag_list = fi;
+ fi->fragment = info->num_fragments;
memcpy((char *)info->fragment + info->frag_offset, info->block, size);
info->frag_offset += size;
diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h
index d79b852..c4cd8a1 100644
--- a/mkfs/mkfs.h
+++ b/mkfs/mkfs.h
@@ -49,7 +49,6 @@ typedef struct {
size_t max_fragments;
int file_block_count;
- file_info_t *frag_list;
size_t frag_offset;
id_table_t idtbl;