OSDN Git Service

io_uring: remove obsolete @mm_fault
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 11 Apr 2020 23:05:01 +0000 (02:05 +0300)
committerJens Axboe <axboe@kernel.dk>
Sun, 12 Apr 2020 14:46:30 +0000 (08:46 -0600)
If io_submit_sqes() can't grab an mm, it fails and exits right away.
There is no need to track the fact of the failure. Remove @mm_fault.

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

index 5190bfb..8153247 100644 (file)
@@ -5818,7 +5818,6 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr,
        struct io_submit_state state, *statep = NULL;
        struct io_kiocb *link = NULL;
        int i, submitted = 0;
-       bool mm_fault = false;
 
        /* if we have a backlog and couldn't flush it all, return BUSY */
        if (test_bit(0, &ctx->sq_check_overflow)) {
@@ -5872,8 +5871,7 @@ fail_req:
                }
 
                if (io_op_defs[req->opcode].needs_mm && !*mm) {
-                       mm_fault = mm_fault || !mmget_not_zero(ctx->sqo_mm);
-                       if (unlikely(mm_fault)) {
+                       if (unlikely(!mmget_not_zero(ctx->sqo_mm))) {
                                err = -EFAULT;
                                goto fail_req;
                        }