summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-11-24 21:33:09 -0700
committerJens Axboe <axboe@kernel.dk>2018-12-22 08:23:03 -0700
commitd11e7e5cf53d40c05497f26865ca25e74589c586 (patch)
tree65a2aaf2a92a6ab8fc0880c03b51a1c9c0ec5639
parente444daad16a7b3fceae5ee4cf1377a952a7c8a30 (diff)
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> Tested-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/aio.c3
1 files changed, 1 insertions, 2 deletions
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;