process_fragments: move fragment checksumming to the process fragment threads
Move fragment checksumming to the process fragment threads, and away
from the main thread.
This has a couple of minor side effects:
1. Tail end fragments (fragments belonging to files larger than the
block size) are now checksummed up front.
2. This means add_non_dup() gains an extra checksum_frag_flag,
because we now have a combination of True/False statuses for
the block checksum and the fragment checksum. Previously, we
either had both the block checksum and fragment checksum, or neither.
(fragments pre-existing on disk on append are not checksummed up front).
3. duplicate() no longer needs the fragment checksum to be passed,
because it is contained within the file_buffer structure which
is always passed.
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
3 files changed