From: Jens Axboe Date: Sun, 25 Nov 2018 04:33:09 +0000 (-0700) Subject: aio: use iocb_put() instead of open coding it X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=71ebc6fef0f53459f37fb39e1466792232fa52ee;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Jens Axboe --- diff --git a/fs/aio.c b/fs/aio.c index 0f9867ef2fc2..59044e53b355 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -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;