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>
Thu, 3 Jan 2019 15:14:02 +0000 (08:14 -0700)
commit7bdf7bb6b8cc1f3642ecd021b51c987c75120d09
tree0bd6c3943c4f6458ebfd5a5c7edb667ee95cf1a8
parentc5f346c7b9720e78122cb521c70546fda946b578
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