From: Jens Axboe <ax...@kernel.dk>

commit 71ebc6fef0f53459f37fb39e1466792232fa52ee upstream.

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

Reviewed-by: Christoph Hellwig <h...@lst.de>
Signed-off-by: Jens Axboe <ax...@kernel.dk>
Cc: Guenter Roeck <li...@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 fs/aio.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1886,10 +1886,9 @@ static int io_submit_one(struct kioctx *
                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;


Reply via email to