diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-03-01 22:34:23 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-03-01 22:34:45 +0100 |
commit | 37485168b9a9ab870f5d8bf01da8cccb325f6de4 (patch) | |
tree | 44c5334eefe2d119b0309e412d4bd2f8e7bdfa49 /lib/sqfs/block_processor | |
parent | aaf7e68c75a907c3c08e83dfd2972665a0f1c1a3 (diff) |
Add a "do not deduplicate" block flag
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor')
-rw-r--r-- | lib/sqfs/block_processor/common.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/sqfs/block_processor/common.c b/lib/sqfs/block_processor/common.c index ab83b5d..2c6e59e 100644 --- a/lib/sqfs/block_processor/common.c +++ b/lib/sqfs/block_processor/common.c @@ -142,11 +142,15 @@ int process_completed_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag, proc->stats.total_frag_count += 1; - err = sqfs_frag_table_find_tail_end(proc->frag_tbl, frag->checksum, - frag->size, &index, &offset); - if (err == 0) { - sqfs_inode_set_frag_location(*(frag->inode), index, offset); - return 0; + if (!(frag->flags & SQFS_BLK_DONT_DEDUPLICATE)) { + err = sqfs_frag_table_find_tail_end(proc->frag_tbl, + frag->checksum, frag->size, + &index, &offset); + if (err == 0) { + sqfs_inode_set_frag_location(*(frag->inode), + index, offset); + return 0; + } } if (proc->frag_block != NULL) { |