io_uring: do not recalculate ppos unnecessarily
authorDylan Yudaken <dylany@fb.com>
Tue, 22 Feb 2022 10:55:03 +0000 (02:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:22:44 +0000 (07:22 +0100)
commit05d69b372b3b2af69ac81908c34e8530deabd216
tree0c58b5348e7f671b4f32fde410fd866c25a33b10
parentff8a070253d906dc325784ac48fe8bf695b91df6
io_uring: do not recalculate ppos unnecessarily

commit b4aec40015953b65f2f114641e7fd7714c8df8e6 upstream.

There is a slight optimisation to be had by calculating the correct pos
pointer inside io_kiocb_update_pos and then using that later.

It seems code size drops by a bit:
000000000000a1b0 0000000000000400 t io_read
000000000000a5b0 0000000000000319 t io_write

vs
000000000000a1b0 00000000000003f6 t io_read
000000000000a5b0 0000000000000310 t io_write

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/io_uring.c