Skip to content

Commit 5f36411

Browse files
isilenceaxboe
authored andcommitted
io_uring/net: open code io_net_vec_assign()
Get rid of io_net_vec_assign() by open coding it into its only caller. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/19191c34b5cfe1161f7eeefa6e785418ea9ad56d.1743202294.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent a20b863 commit 5f36411

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

io_uring/net.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,6 @@ static struct io_async_msghdr *io_msg_alloc_async(struct io_kiocb *req)
176176
return hdr;
177177
}
178178

179-
/* assign new iovec to kmsg, if we need to */
180-
static void io_net_vec_assign(struct io_kiocb *req, struct io_async_msghdr *kmsg,
181-
struct iovec *iov)
182-
{
183-
if (iov) {
184-
req->flags |= REQ_F_NEED_CLEANUP;
185-
io_vec_reset_iovec(&kmsg->vec, iov, kmsg->msg.msg_iter.nr_segs);
186-
}
187-
}
188-
189179
static inline void io_mshot_prep_retry(struct io_kiocb *req,
190180
struct io_async_msghdr *kmsg)
191181
{
@@ -217,7 +207,11 @@ static int io_net_import_vec(struct io_kiocb *req, struct io_async_msghdr *iomsg
217207
&iomsg->msg.msg_iter, io_is_compat(req->ctx));
218208
if (unlikely(ret < 0))
219209
return ret;
220-
io_net_vec_assign(req, iomsg, iov);
210+
211+
if (iov) {
212+
req->flags |= REQ_F_NEED_CLEANUP;
213+
io_vec_reset_iovec(&iomsg->vec, iov, iomsg->msg.msg_iter.nr_segs);
214+
}
221215
return 0;
222216
}
223217

0 commit comments

Comments
 (0)