summaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-12 12:34:23 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-12 15:45:00 +0200
commit3038bf18d12b9d97d13b4846fed301c054cd793f (patch)
tree0e17a686df213609134d69030ebced034cdc3bef /lib/sqfs/data_writer.c
parente4dd1ed8c9cea1761092e8206d572f60a9d95a58 (diff)
Simplify writer code for files without a fragment
The data writer sparse block code can take advantage that it can add a block size instead of a fragment and doesn't have to initialize the framgent location. In return, the tree node to inode serialization code doesn't need a special case for sparse file anymore and can now also handle files that are forced to not have a fragment. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/data_writer.c')
-rw-r--r--lib/sqfs/data_writer.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/sqfs/data_writer.c b/lib/sqfs/data_writer.c
index 8492c98..557b85b 100644
--- a/lib/sqfs/data_writer.c
+++ b/lib/sqfs/data_writer.c
@@ -118,13 +118,7 @@ static int flush_data_block(data_writer_t *data, size_t size, file_info_t *fi)
uint32_t out;
if (is_zero_block(data->block, size)) {
- if (size < data->super->block_size) {
- fi->fragment_offset = 0xFFFFFFFF;
- fi->fragment = 0xFFFFFFFF;
- } else {
- fi->blocksizes[data->block_idx++] = 0;
- }
-
+ fi->blocksizes[data->block_idx++] = 0;
fi->sparse += size;
return 0;
}