summaryrefslogtreecommitdiff
path: root/lib/sqfs/block_writer.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-01 22:34:23 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-01 22:34:45 +0100
commit37485168b9a9ab870f5d8bf01da8cccb325f6de4 (patch)
tree44c5334eefe2d119b0309e412d4bd2f8e7bdfa49 /lib/sqfs/block_writer.c
parentaaf7e68c75a907c3c08e83dfd2972665a0f1c1a3 (diff)
Add a "do not deduplicate" block flag
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_writer.c')
-rw-r--r--lib/sqfs/block_writer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqfs/block_writer.c b/lib/sqfs/block_writer.c
index 73dcb14..e252c89 100644
--- a/lib/sqfs/block_writer.c
+++ b/lib/sqfs/block_writer.c
@@ -229,7 +229,7 @@ int sqfs_block_writer_write(sqfs_block_writer_t *wr, sqfs_u32 size,
if (count == 0) {
*location = 0;
- } else {
+ } else if (!(flags & SQFS_BLK_DONT_DEDUPLICATE)) {
start = deduplicate_blocks(wr, count);
offset = wr->blocks[start].offset;
@@ -244,11 +244,11 @@ int sqfs_block_writer_write(sqfs_block_writer_t *wr, sqfs_u32 size,
} else {
wr->num_blocks = wr->file_start;
}
- }
- err = wr->file->truncate(wr->file, wr->start);
- if (err)
- return err;
+ err = wr->file->truncate(wr->file, wr->start);
+ if (err)
+ return err;
+ }
wr->stats.blocks_written = wr->num_blocks;
wr->stats.bytes_written = wr->start - wr->data_area_start;