1
0
Fork 0

aio: use iocb_put() instead of open coding it

Replace the percpu_ref_put() + kmem_cache_free() with a call to
iocb_put() instead.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
hifive-unleashed-5.1
Jens Axboe 2018-11-24 21:33:09 -07:00
parent a79d40e9b0
commit 71ebc6fef0
1 changed files with 1 additions and 2 deletions

View File

@ -1886,10 +1886,9 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
goto out_put_req;
return 0;
out_put_req:
percpu_ref_put(&ctx->reqs);
if (req->ki_eventfd)
eventfd_ctx_put(req->ki_eventfd);
kmem_cache_free(kiocb_cachep, req);
iocb_put(req);
out_put_reqs_available:
put_reqs_available(ctx, 1);
return ret;