summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-01-19 13:32:40 +0000
committerJens Axboe <axboe@kernel.dk>2021-02-01 10:02:42 -0700
commit85bcb6c67ea145b8032089db891218e3339cbdb8 (patch)
treeed85002f3393bdda7bb366589a3827cc945037b7 /fs
parent888aae2eeddfe1d6c9731cf4af1a1b2605af6470 (diff)
downloadlinux-85bcb6c67ea145b8032089db891218e3339cbdb8.tar.bz2
io_uring: simplify io_alloc_req()
Get rid of a label in io_alloc_req(), it's cleaner to do return directly. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-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 0a578c40b854..9ff84ceff4f9 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1988,7 +1988,7 @@ static struct io_kiocb *io_alloc_req(struct io_ring_ctx *ctx,
if (unlikely(ret <= 0)) {
state->reqs[0] = kmem_cache_alloc(req_cachep, gfp);
if (!state->reqs[0])
- goto fallback;
+ return io_get_fallback_req(ctx);
ret = 1;
}
state->free_reqs = ret;
@@ -1996,8 +1996,6 @@ static struct io_kiocb *io_alloc_req(struct io_ring_ctx *ctx,
state->free_reqs--;
return state->reqs[state->free_reqs];
-fallback:
- return io_get_fallback_req(ctx);
}
static inline void io_put_file(struct io_kiocb *req, struct file *file,