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 14:25:34 +0000 (08:25 -0600)
commite097beda49b559dbdab0096f88a2bb23c37b935d
tree320e4aaa810a5a9e37661ca65415b9c176eb66fa
parenta4c49d4eebf8cb93fe32478b9195fd832064abfd
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