diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-11-20 20:06:23 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-12-18 08:29:59 -0700 |
commit | 875736bb3f3ded168469f6a14df7a938416a99d5 (patch) | |
tree | 5be195ce582e53516779e130826c0045bf9a1307 /fs | |
parent | 88a6f18b950e2e4dce57d31daa151105f4f3dcff (diff) | |
download | linux-875736bb3f3ded168469f6a14df7a938416a99d5.tar.bz2 |
aio: abstract out io_event filler helper
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1065,6 +1065,15 @@ static inline void iocb_put(struct aio_kiocb *iocb) } } +static void aio_fill_event(struct io_event *ev, struct aio_kiocb *iocb, + long res, long res2) +{ + ev->obj = (u64)(unsigned long)iocb->ki_user_iocb; + ev->data = iocb->ki_user_data; + ev->res = res; + ev->res2 = res2; +} + /* aio_complete * Called when the io request on the given iocb is complete. */ @@ -1092,10 +1101,7 @@ static void aio_complete(struct aio_kiocb *iocb, long res, long res2) ev_page = kmap_atomic(ctx->ring_pages[pos / AIO_EVENTS_PER_PAGE]); event = ev_page + pos % AIO_EVENTS_PER_PAGE; - event->obj = (u64)(unsigned long)iocb->ki_user_iocb; - event->data = iocb->ki_user_data; - event->res = res; - event->res2 = res2; + aio_fill_event(event, iocb, res, res2); kunmap_atomic(ev_page); flush_dcache_page(ctx->ring_pages[pos / AIO_EVENTS_PER_PAGE]); |