io_uring: add IORING_SETUP_SINGLE_ISSUER
[platform/kernel/linux-starfive.git] / io_uring / io_uring.c
index 85a4795..0677213 100644 (file)
@@ -2457,6 +2457,8 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
        io_destroy_buffers(ctx);
        if (ctx->sq_creds)
                put_cred(ctx->sq_creds);
+       if (ctx->submitter_task)
+               put_task_struct(ctx->submitter_task);
 
        /* there are no registered resources left, nobody uses it */
        if (ctx->rsrc_node)
@@ -3189,7 +3191,7 @@ static int io_uring_install_fd(struct io_ring_ctx *ctx, struct file *file)
        if (fd < 0)
                return fd;
 
-       ret = io_uring_add_tctx_node(ctx);
+       ret = __io_uring_add_tctx_node(ctx, false);
        if (ret) {
                put_unused_fd(fd);
                return ret;
@@ -3409,7 +3411,8 @@ static long io_uring_setup(u32 entries, struct io_uring_params __user *params)
                        IORING_SETUP_CLAMP | IORING_SETUP_ATTACH_WQ |
                        IORING_SETUP_R_DISABLED | IORING_SETUP_SUBMIT_ALL |
                        IORING_SETUP_COOP_TASKRUN | IORING_SETUP_TASKRUN_FLAG |
-                       IORING_SETUP_SQE128 | IORING_SETUP_CQE32))
+                       IORING_SETUP_SQE128 | IORING_SETUP_CQE32 |
+                       IORING_SETUP_SINGLE_ISSUER))
                return -EINVAL;
 
        return io_uring_create(entries, &p, params);