summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-11-24 21:33:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-02 09:58:58 +0200
commit4d677689742ab60d5be46e20708276368564427a (patch)
treea99ca5ee6836b104b087f741ae3678c312882aa6 /fs
parentef529eead8cfc11c051b90d239e7137f7141ea94 (diff)
downloadlinux-stable-4d677689742ab60d5be46e20708276368564427a.tar.gz
linux-stable-4d677689742ab60d5be46e20708276368564427a.tar.bz2
linux-stable-4d677689742ab60d5be46e20708276368564427a.zip
aio: use iocb_put() instead of open coding it
commit 71ebc6fef0f53459f37fb39e1466792232fa52ee upstream. 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> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/aio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 2547f17b4fef..e2b63ab28ecc 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;