io_uring: cache async and regular file state for fixed files
authorJens Axboe <axboe@kernel.dk>
Fri, 12 Mar 2021 15:30:14 +0000 (08:30 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 4 Apr 2021 21:27:19 +0000 (15:27 -0600)
commit863ad3eb75b1e9e0a738f8c27f5016832aa59c7c
tree7e2ad42b3ebd15221e031b9fe660435e7b9d4f35
parent5c0626a6803d6ece8e01996d3976bb179af88369
io_uring: cache async and regular file state for fixed files

We have to dig quite deep to check for particularly whether or not a
file supports a fast-path nonblock attempt. For fixed files, we can do
this lookup once and cache the state instead.

This adds two new bits to track whether we support async read/write
attempt, and lines up the REQ_F_ISREG bit with those two. The file slot
re-uses the last 3 (or 2, for 32-bit) of the file pointer to cache that
state, and then we mask it in when we go and use a fixed file.

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