In lbd, atomic writes will require a pblk array in the lbd object. Not sure how to roll back partial allocations yet but it should be doable. For async reads: - lbd_read() is called by compress_read() and compress_write(). lbd may have multiple simultaneous callers. lbd calls lbatview_read() and reads its own data. - lbatview_read() is called by lbd. lbatview may have multiple simultaneous callers. lbatview calls pbat_read() and reads its own data. - pbat_read() is called by lbatview_alloc_pblk() and lbatview_free_pblk(). pbat may have multiple simultaneous callers. pbat calls pbat_read(). Rework cache ownership: - compress_open() should alloc only lbdcache. - lbdcache should alloc only lbatviewcache. - lbatviewcache should alloc lbatpagecache and pbatcache. Cache object sizing: - lbdcache size: multiple of num_online_cpus(). - lbatviewcache: Min: one. Max: one per lbd. Avg: 1/2 lbdcache size. => Alloc 1/2 lbdcache size. - lbpatpage cache: Min: lbatviewcache size. Max: 2 * lbatviewcache size. Avg: 1.5 * lbatviewcache size. => alloc 1.5 * lbatviewcache size. - pbatcache size: Min: 1 Max: lbatviewcache size. Avg: 1/2 lbatviewcache size. => alloc ??? 1/2 lbatviewcache size is way too large. Ratio of lbatview to pbat is 1:lbat_per_pbat. Cache objects should dynamically expand. TODO: - Move back to module based build system. - Make compression algorithm and speed/level selectable. - Create utilities for: - Resizing a compressed device. - Checking and repairing a compressed device. - Check parameters in compress_ctr: - Compressed device must be large enough. - Backing device must be large enough. - Remove workqueue. - (?) Function ptrs for reading and writing lblk_alloc.