Commit f15a3431 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: deduplicate io_queue_sqe() call sites

There are two call sites of io_queue_sqe() in io_submit_sqe(), combine
them into one, because io_queue_sqe() is inline and we don't want to
bloat binary, and will become even bigger

   text    data     bss     dec     hex filename
  92126   13986       8  106120   19e88 ./fs/io_uring.o
  91966   13986       8  105960   19de8 ./fs/io_uring.o
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/506124b8e767f0a4576f7a459f6aea3d13fb4dda.1632516769.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 553deffd
...@@ -7117,20 +7117,18 @@ static int io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req, ...@@ -7117,20 +7117,18 @@ static int io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
link->last->link = req; link->last->link = req;
link->last = req; link->last = req;
if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK))
return 0;
/* last request of a link, enqueue the link */ /* last request of a link, enqueue the link */
if (!(req->flags & (REQ_F_LINK | REQ_F_HARDLINK))) { link->head = NULL;
link->head = NULL; req = head;
io_queue_sqe(head); } else if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK)) {
} link->head = req;
} else { link->last = req;
if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK)) { return 0;
link->head = req;
link->last = req;
} else {
io_queue_sqe(req);
}
} }
io_queue_sqe(req);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment