Commit 6f83ab2
committed
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: b4aec40 ("io_uring: do not recalculate ppos unnecessarily")
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent c4212f3 commit 6f83ab2
1 file changed
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3183 | 3183 | | |
3184 | 3184 | | |
3185 | 3185 | | |
3186 | | - | |
3187 | 3186 | | |
3188 | | - | |
3189 | | - | |
3190 | | - | |
3191 | | - | |
3192 | | - | |
3193 | | - | |
3194 | | - | |
3195 | | - | |
3196 | | - | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
3197 | 3194 | | |
3198 | | - | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
3199 | 3198 | | |
3200 | 3199 | | |
3201 | 3200 | | |
| |||
0 commit comments