mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
io_uring: remove duplicated calls to io_kiocb_ppos
commit af9c45eceb
upstream.
io_kiocb_ppos is called in both branches, and it seems that the compiler
does not fuse this. Fusing removes a few bytes from loop_rw_iter.
Before:
$ nm -S fs/io_uring.o | grep loop_rw_iter
0000000000002430 0000000000000124 t loop_rw_iter
After:
$ nm -S fs/io_uring.o | grep loop_rw_iter
0000000000002430 000000000000010d t loop_rw_iter
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>
This commit is contained in:
parent
c5d4437385
commit
57e5067f43
1 changed files with 5 additions and 2 deletions
|
@ -3303,6 +3303,7 @@ static ssize_t loop_rw_iter(int rw, struct io_kiocb *req, struct iov_iter *iter)
|
|||
struct kiocb *kiocb = &req->rw.kiocb;
|
||||
struct file *file = req->file;
|
||||
ssize_t ret = 0;
|
||||
loff_t *ppos;
|
||||
|
||||
/*
|
||||
* Don't support polled IO through this interface, and we can't
|
||||
|
@ -3314,6 +3315,8 @@ static ssize_t loop_rw_iter(int rw, struct io_kiocb *req, struct iov_iter *iter)
|
|||
if (kiocb->ki_flags & IOCB_NOWAIT)
|
||||
return -EAGAIN;
|
||||
|
||||
ppos = io_kiocb_ppos(kiocb);
|
||||
|
||||
while (iov_iter_count(iter)) {
|
||||
struct iovec iovec;
|
||||
ssize_t nr;
|
||||
|
@ -3327,10 +3330,10 @@ static ssize_t loop_rw_iter(int rw, struct io_kiocb *req, struct iov_iter *iter)
|
|||
|
||||
if (rw == READ) {
|
||||
nr = file->f_op->read(file, iovec.iov_base,
|
||||
iovec.iov_len, io_kiocb_ppos(kiocb));
|
||||
iovec.iov_len, ppos);
|
||||
} else {
|
||||
nr = file->f_op->write(file, iovec.iov_base,
|
||||
iovec.iov_len, io_kiocb_ppos(kiocb));
|
||||
iovec.iov_len, ppos);
|
||||
}
|
||||
|
||||
if (nr < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue