]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - fs/io_uring.c
io_uring: use fget/fput_many() for file references
authorJens Axboe <axboe@kernel.dk>
Wed, 9 Jan 2019 16:06:50 +0000 (09:06 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 28 Feb 2019 15:24:23 +0000 (08:24 -0700)
commit9a56a2323dbbd8ed7f380a5af7ae3ff82caa55a6
tree20ddaf421caad14ca9e24bfe211b4c7a86234a69
parent091141a42e15fe47ada737f3996b317072afcefb
io_uring: use fget/fput_many() for file references

Add a separate io_submit_state structure, to cache some of the things
we need for IO submission.

One such example is file reference batching. io_submit_state. We get as
many references as the number of sqes 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 io_iopoll_reap().

Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c