aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/pthread.c
AgeCommit message (Collapse)Author
2019-09-25Rename block processor to sqfs_data_writer_tDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-25More refactoring of the block processorDavid Oberhollenzer
Basically just moving functions around and renaming things. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-25Refactor out common code of the block processorsDavid Oberhollenzer
Code that already is shared between the pthread and the serial processor as well as code that can be re-used by other threading API implementations. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-25Cleanup pthread queue processing codeDavid Oberhollenzer
This commit removes duplicated code paths from the block processor finish function, i.e. reimplementing it using the existing queue processing function and merges cleanup code paths in the later. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-24Bring back batched dequeuingDavid Oberhollenzer
Instead of doing piece-wise block dequeuing, take as many consequitive blocks as we can and in the comparetively rare* case that we produce a fragment block, put everything back for the next run. *rare because a lot of fragments are eaten by deduplication and even after that, a number of them are required to fill a block. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-24Clenaup error handlingDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-24Do the fragment checksumming in the workter threadDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-24Move entire fragment processing from data writer to block processorDavid Oberhollenzer
So far, this is mostly a direct port from the block processor. The actual fragment checksumming is not done through the thread pool. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-24Cleanup pthread based block processing codeDavid Oberhollenzer
Break convoluted, long functions up into smaller ones where the control flow (especially locking and signalling) is more easily readable and remove some copy and paste clean up code. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-24Process completed blocks one-by-oneDavid Oberhollenzer
This commit makes sure the block processor enqueue function dequeues at most a single block which it dispatches. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-23Cleanup block processor error handlingDavid Oberhollenzer
If an error happpens, immediately stop everything and report only the first error that happened. This also fixes a memory leak in the error paths of the serial and pthread based block processors. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-23Cleanup block processor flag handlingDavid Oberhollenzer
First, remove the "Don't checksum" flag, fragment blocks also need to be checksumed and are also subject to deduplication. For sentinel blocks, instead check if the size is zero. Second, cleanly seperate the user settable flags from the non-user settable flags and reject any block that has non-user settable or unknown flags set. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-23Move the bulk of the work from the data writer to the block processorDavid Oberhollenzer
Instead of calling a callback, the block processor now takes care of writing the data blocks to the file in the correct order, keeping track of fragment blocks and deduplicating blocks. Some cleanup work remains to be done and the statistics have to be repaired (yet again). Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-21Merge some of serial & pthread block processor code paths/declarationsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-13Make block process helper function internalDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-12Cleanup: move block processor code to sub directoryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>