]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: io_kiocb_update_pos() should not touch file for non -1 offset
authorJens Axboe <axboe@kernel.dk>
Mon, 11 Apr 2022 15:48:30 +0000 (09:48 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 11 Apr 2022 22:38:21 +0000 (16:38 -0600)
commit479307e4a996a08c5927492f0392a22410f62f72
tree4cd7f5945b9b85df8aa99e446b8aa1a779777ec6
parente6f30e0f7c0394c303f84f8ca0832b1962946876
io_uring: io_kiocb_update_pos() should not touch file for non -1 offset

-1 tells use to use the current position, but we check if the file is
a stream regardless of that. Fix up io_kiocb_update_pos() to only
dip into file if we need to. This is both more efficient and also drops
12 bytes of text on aarch64 and 64 bytes on x86-64.

Fixes: d31f0510d38e ("io_uring: do not recalculate ppos unnecessarily")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c