On Wed, May 27, 2015 at 11:53:17AM -0700, Tom Marshall wrote: > 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. Not all file systems use mpage_end_io(), so that's not a good solution. You can do something like wait_on_page_bit(page, PG_uptodate); ... although to be robust you will also need to wake up if PG_error is set (if there is an I/O error, PG_error is set instead of PG_uptodate). So that means you'd have to spin your own wait function using the waitqueue primitives and page_waitqueue(), using __wait_on_bit() as an initial model. This suggestion should not be taken as an endorsement of your higher-levle architecture. I suggest you think very carefully about whether or not you need to be able to support random write functionality, and if you don't, there are simpler ways such as the one I outlined to you earlier. Regards, and good luck, - Ted -- 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