From patchwork Tue Dec 4 23:37:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10712751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0AA7013AF for ; Tue, 4 Dec 2018 23:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B9029C3A for ; Tue, 4 Dec 2018 23:38:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E496529ED2; Tue, 4 Dec 2018 23:38:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9546029C3A for ; Tue, 4 Dec 2018 23:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726624AbeLDXiA (ORCPT ); Tue, 4 Dec 2018 18:38:00 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:41253 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbeLDXh7 (ORCPT ); Tue, 4 Dec 2018 18:37:59 -0500 Received: by mail-pl1-f195.google.com with SMTP id u6so9065226plm.8 for ; Tue, 04 Dec 2018 15:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=46YCPSjyTrlcpzDW0Ukbp5ofhNBoK9a5mtdA0d9T/5Q=; b=iIOYrDG1w21bEIhxrVmcfUuIG9VXHhcogcg/cq1Gt9ZqZRTpydmQBC14v9zhevMLCh e6l1w6XYqIBYTUjZQ2N+stYk9KYQPmrVfqyws6i1HGuBa2ppJutarQ10T+ZgRKTmVYoQ Oy7U0uk2PtG22JANA132fuiQbqifl9MnbyHOErzBI8EkG6vL47TBlVyXr5UXV1ax4hAP pMOPToAUTqdUjNJ+fmCjnDZI75Yt/BWH2KKbkIjGkvSwwLSkI7kWoUeoAPNo63twvvVn YNBH2fI7Vg4fr2S4vbb/boz2/0KXdz8icZmUHeozFMg57o0wQWLFIST2dGt40VGV8l+x BGow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=46YCPSjyTrlcpzDW0Ukbp5ofhNBoK9a5mtdA0d9T/5Q=; b=YQg/0Pj6sASf/E8PBfkEzuMVyIiKb5W3AbiJkCU9qV9lH51ovhr4hMy/Ggekln+JvL oS2iIdTqH5Pcu8V2tqT9DdnbzSMGCUUsmZGlWjhCjxlaDXEFElbtJahqVhmbjM4C3jq2 zhW031FhKnufkbJt/5IcXJKzPsH+81qMBbV+6jscrSqvPR9/H8EsOXe1rm5ATngnVI1e WMziCyleh9pti/nxV1KPfMTqIlKHLX6e6skmTyudECWwcDnl/6cS8X7aocaXpRFLnrmY tTHC5gQwM7+AQ8WJvuIjbEAROIyWv3TlqPqIHuLlAi6WXF9qLj48LcXeS1GI+JtkUs8O mptQ== X-Gm-Message-State: AA+aEWZiP9HArUoOmB6Mn0WPAkR5YiESFA8TEuRVJTxeSawrzD+kgeOi LCoM0vNktXTEDrqFsw53kC8Rjw== X-Google-Smtp-Source: AFSGD/UByFXnwmtPsEbw4UOJJ15sI+ebt+u8iHRY3wQ2xSWWc9vAfal2jXUYSmX3RM3NmyowY9q6jA== X-Received: by 2002:a17:902:541:: with SMTP id 59mr22448986plf.88.1543966679118; Tue, 04 Dec 2018 15:37:59 -0800 (PST) Received: from x1.localdomain (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id t13sm22527635pgr.42.2018.12.04.15.37.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 15:37:58 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org Cc: hch@lst.de, jmoyer@redhat.com, Jens Axboe Subject: [PATCH 10/26] aio: use iocb_put() instead of open coding it Date: Tue, 4 Dec 2018 16:37:13 -0700 Message-Id: <20181204233729.26776-11-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204233729.26776-1-axboe@kernel.dk> References: <20181204233729.26776-1-axboe@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the percpu_ref_put() + kmem_cache_free() with a call to iocb_put() instead. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- fs/aio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index ed6c3914477a..cf93b92bfb1e 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1884,10 +1884,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;