aio: use fget/fput_many() for file references
authorJens Axboe <axboe@kernel.dk>
Fri, 30 Nov 2018 01:58:24 +0000 (18:58 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Dec 2018 17:13:09 +0000 (10:13 -0700)
commita25d1164cd68d3582eb7ce52da3a3b0291aea53f
treea06d829ff94df485234fb85aba1b819f1f8a0b1e
parent67e82f8ba664f6aa16186d7b4a1a5ecc3a319c01
aio: use fget/fput_many() for file references

On the submission side, add file reference batching to the
aio_submit_state. We get as many references as the number of iocbs we
are submitting, and drop unused ones if we end up switching files. The
assumption here is that we're usually only dealing with one fd, and if
there are multiple, hopefuly they are at least somewhat ordered. Could
trivially be extended to cover multiple fds, if needed.

On the completion side we do the same thing, except this is trivially
done just locally in aio_iopoll_reap().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/aio.c