diff options
author | Jens Axboe <axboe@fb.com> | 2015-03-05 16:29:35 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-03-06 08:38:54 -0700 |
commit | 119976ee675beaf77397a48f7ecc25c598d48854 (patch) | |
tree | 6b3b11d2e09b86bf3aaba8e32cb9e13736a930a3 | |
parent | 0f3c2cfad63c1fe6b3939a82ab62cd01de121a47 (diff) |
aio: propagate and use queue cookieblk-polled-io
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | fs/aio.c | 8 | ||||
-rw-r--r-- | fs/direct-io.c | 3 | ||||
-rw-r--r-- | include/linux/aio.h | 3 |
3 files changed, 13 insertions, 1 deletions
@@ -783,11 +783,17 @@ static int kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, */ ssize_t wait_on_sync_kiocb(struct kiocb *req) { + struct backing_dev_info *bdi = NULL; + + if (req->ki_filp) + bdi = inode_to_bdi(req->ki_filp->f_inode); + while (!req->ki_ctx) { set_current_state(TASK_UNINTERRUPTIBLE); if (req->ki_ctx) break; - io_schedule(); + + bdi_io_wait(bdi, req->ki_queue_cookie); } __set_current_state(TASK_RUNNING); return req->ki_user_data; diff --git a/fs/direct-io.c b/fs/direct-io.c index adc588ad22da..35c33f4178d2 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -403,6 +403,9 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) } else dio->bio_cookie = submit_bio(dio->rw, bio); + if (dio->iocb) + dio->iocb->ki_queue_cookie = dio->bio_cookie; + sdio->bio = NULL; sdio->boundary = 0; sdio->logical_offset_in_bio = 0; diff --git a/include/linux/aio.h b/include/linux/aio.h index d9c92daa3944..1e897fd633d5 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h @@ -8,6 +8,7 @@ #include <linux/rcupdate.h> #include <linux/atomic.h> +#include <linux/blk_types.h> struct kioctx; struct kiocb; @@ -52,6 +53,8 @@ struct kiocb { * this is the underlying eventfd context to deliver events to. */ struct eventfd_ctx *ki_eventfd; + + queue_cookie_t ki_queue_cookie; }; static inline bool is_sync_kiocb(struct kiocb *kiocb) |