summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJackie Liu <liuyun01@kylinos.cn>2019-09-18 04:37:52 +0200
committerJens Axboe <axboe@kernel.dk>2019-09-18 19:19:06 +0200
commit954dab193d19cbbff8f83b58c9360bf00ddb273c (patch)
tree106599064e4defb8e95eb3a4e78695a0f4082566 /fs/io_uring.c
parentio_uring: increase IORING_MAX_ENTRIES to 32K (diff)
downloadlinux-954dab193d19cbbff8f83b58c9360bf00ddb273c.tar.xz
linux-954dab193d19cbbff8f83b58c9360bf00ddb273c.zip
io_uring: use kmemdup instead of kmalloc and memcpy
Just clean up the code, no function changes. Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0dadbdbead0f..42a684ef578a 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2098,13 +2098,11 @@ static int __io_queue_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
if (ret == -EAGAIN && !(req->flags & REQ_F_NOWAIT)) {
struct io_uring_sqe *sqe_copy;
- sqe_copy = kmalloc(sizeof(*sqe_copy), GFP_KERNEL);
+ sqe_copy = kmemdup(s->sqe, sizeof(*sqe_copy), GFP_KERNEL);
if (sqe_copy) {
struct async_list *list;
- memcpy(sqe_copy, s->sqe, sizeof(*sqe_copy));
s->sqe = sqe_copy;
-
memcpy(&req->submit, s, sizeof(*s));
list = io_async_list_from_sqe(ctx, s->sqe);
if (!io_add_to_prev_work(list, req)) {