fs: add IOCB flags related to passing back dio completions
authorJens Axboe <axboe@kernel.dk>
Sat, 8 Jul 2023 15:55:27 +0000 (09:55 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 19 Jul 2023 19:45:57 +0000 (13:45 -0600)
commit3a943ce468d71bdc77d68b9feb419d3acbb0474b
tree17124ce337a2264de8d2687fefd636df2f5f9016
parenta5d5d0f766b03d29dfac9567bb4d24410f98fa8d
fs: add IOCB flags related to passing back dio completions

Async dio completions generally happen from hard/soft IRQ context, which
means that users like iomap may need to defer some of the completion
handling to a workqueue. This is less efficient than having the original
issuer handle it, like we do for sync IO, and it adds latency to the
completions.

Add IOCB_DIO_DEFER, which the issuer can set if it is able to safely
punt these completions to a safe context. If the dio handler is aware
of this flag, assign a callback handler in kiocb->dio_complete and
associated data io kiocb->private. The issuer will then call this handler
with that data from task context.

No functional changes in this patch.

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