io_uring: avoid touching inode in rw prep
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 9 Aug 2021 12:04:04 +0000 (13:04 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Aug 2021 15:05:44 +0000 (09:05 -0600)
commitfa68cad6b93f684951d5d4fc6d7f4ae3456239cf
tree818c43e442f7c3da8cfbc3d3413c3ffe2d15e821
parentc06d247e1064983c2783f282d58bd8cd8ca44280
io_uring: avoid touching inode in rw prep

If we use fixed files, we can be sure (almost) that REQ_F_ISREG is set.
However, for non-reg files io_prep_rw() still will look into inode to
double check, and that's expensive and can be avoided.

The only caveat is that it only currently works with 64+ bit
architectures, see FFS_ISREG, so we should consider that.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/0a62780c491ca2522cd52db4ae3f16e03aafed0f.1628471125.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c