As I mentioned earlier, I had a hack working for transparent file
compression. But it has a few problems. The two major ones are (1) It
reads the lower pages synchronously by waiting on pages with
wait_on_page_locked(), destroying readahead, and (2) it is swapping out
i_size to call the lower readpage. So I'm ditching that and going
another route.
My idea now is to create a wrapper inode that is passed back to the VFS
layer. The wrapper inode would have the correct i_size, blkbits, and
implement address_space_operations. The implementation of
readpage/readpages would then call down into the lower filesystem's
readpage/readpages to fetch compressed data. When the required pages
are available, it would decompress and populate its own requested pages.
But one thing I'm wrestling with is how to be asynchronously notified
when the lower readpage/readpages complete. The two ideas that come to
mind are (1) plumbing a callback into mpage_end_io(), (2) allowing
override of mpage_end_io() with a custom function, (3) creating kernel
threads analogous to kblockd to wait for pending pages.
But again, I'm new at this, so maybe there's an easier or better way?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html