Filesystems do not support doing IO as asynchronous in some cases. For example in case of unaligned writes or in case file size needs to be extended (e.g. for ext4). Instead of forcing filesystem to wait for AIO in such cases, add argument to iomap_dio_rw() which makes the function wait for IO completion. This also results in executing iomap_dio_complete() inline in iomap_dio_rw() providing its return value to the caller as for ordinary sync IO.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -195,7 +195,8 @@ struct iomap_dio_ops { · 194 unmodified lines | |||
| 195 | }; | 195 | }; |
| 196 | 196 | ||
| 197 | ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, | 197 | ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, |
| 198 | const struct iomap_ops *ops, const struct iomap_dio_ops *dops); | 198 | const struct iomap_ops *ops, const struct iomap_dio_ops *dops, |
| 199 | bool wait_for_completion); | ||
| 199 | int iomap_dio_iopoll(struct kiocb *kiocb, bool spin); | 200 | int iomap_dio_iopoll(struct kiocb *kiocb, bool spin); |
| 200 | 201 | ||
| 201 | #ifdef CONFIG_SWAP | 202 | #ifdef CONFIG_SWAP |