aio: use fget/fput_many() for file references
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Jan 2019 22:51:45 +0000 (15:51 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 6 Jan 2019 20:52:49 +0000 (13:52 -0700)
commit9c44a0856b76beaa62872b909ce156c9e1bf3b4d
treed2bc56c2599c78135fc9bbe7a7314a9740a5dfda
parente7e6f01d7ddec953269e8d247ec0af9ec5139d5a
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