mm: add support for async page locking
authorJens Axboe <axboe@kernel.dk>
Fri, 22 May 2020 15:12:09 +0000 (09:12 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 23 May 2020 01:29:56 +0000 (19:29 -0600)
commit4cf0789233f199442cd0c4c53b3264ac46bf4124
tree558fcd40c67bde1579de5c8d719f0e0ca5a441d0
parenteba2b9a2475de4f888ed04d8709500131bce9a0a
mm: add support for async page locking

Normally waiting for a page to become unlocked, or locking the page,
requires waiting for IO to complete. Add support for lock_page_async()
and wait_on_page_locked_async(), which are callback based instead. This
allows a caller to get notified when a page becomes unlocked, rather
than wait for it.

We use the iocb->private field to pass in this necessary data for this
to happen. struct wait_page_key is made public, and we define struct
wait_page_async as the interface between the caller and the core.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/fs.h
include/linux/pagemap.h
mm/filemap.c