io_uring: kill NULL checks for submit state
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 21 Jun 2020 10:09:53 +0000 (13:09 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Jun 2020 02:46:05 +0000 (20:46 -0600)
After recent changes, io_submit_sqes() always passes valid submit state,
so kill leftovers checking it for NULL.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index cc1f2f3..c686061 100644 (file)
@@ -1376,11 +1376,7 @@ static struct io_kiocb *io_alloc_req(struct io_ring_ctx *ctx,
        gfp_t gfp = GFP_KERNEL | __GFP_NOWARN;
        struct io_kiocb *req;
 
-       if (!state) {
-               req = kmem_cache_alloc(req_cachep, gfp);
-               if (unlikely(!req))
-                       goto fallback;
-       } else if (!state->free_reqs) {
+       if (!state->free_reqs) {
                size_t sz;
                int ret;