From patchwork Tue Dec 4 23:37:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10712809 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 6CBF1109C for ; Tue, 4 Dec 2018 23:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C27829D8E for ; Tue, 4 Dec 2018 23:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F6C929D16; Tue, 4 Dec 2018 23:38:38 +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=unavailable 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 CA14229489 for ; Tue, 4 Dec 2018 23:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbeLDXif (ORCPT ); Tue, 4 Dec 2018 18:38:35 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41293 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726717AbeLDXif (ORCPT ); Tue, 4 Dec 2018 18:38:35 -0500 Received: by mail-pl1-f196.google.com with SMTP id u6so9065896plm.8 for ; Tue, 04 Dec 2018 15:38:34 -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=wbgdkuX/L3fLyZ228OAfSCXQBLVO7eMAEh2tepSbBGU=; b=bBXaskkDSqkQosN6wAk5w9WEYOsU3jrcxjyNCFdyCv8VLVsw1ua0z7El8d/AxvMACx TJOn/uN82PHV+BPLmdhmj8e5c43c5cYCKX9ALTmHqKe0ROvL+e+K9KjgCL4JISUx5Qi5 Y4zOz47efWiMCDQ2qfwPmvtQoLbPNn5pD74t3t/K+B+tVdEUKSay5H4Y8VbU9vIf2YwB 8bl3w4d/xkSG4gC/F+gysHcf7MoZig950C+DBUe1bm9jG2f80Fw1Y7sIeFgtzx1hI831 a03Qx55MDKWSHb/8ivcvx15gVrcDaZxtYUqUTrfNqd8qC9Gz5fHxOcvO87sYxzrsM4Sy OJKg== 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=wbgdkuX/L3fLyZ228OAfSCXQBLVO7eMAEh2tepSbBGU=; b=MZjn2TUzvvzGAhDI9bksUFKLpLCfvBHlTSA4oDLybekTz92iU0l8QmcTsQDFQaDvYm uQdt9exhqyzYdrYR9KsqTqwNu62jLnsWme40D3m7p9SaDjp+bdj5icb+M/yHKPZp+tos jKTUFsW6bd1qOzLdOPKevcPQYA7fw5CPzxXeIDv0q8yiMvRPCHXnmV24apc+QA2krWoP 7bw2pP+JG3m+U1YRLo64wKP5IotmdMn23F8hYZT8jxocIUtdQk+/6xF2hdjWF5VmjW/k Up90L1ha3UigbKpY0zxHSSD9Mi+3zonm+vO7zubWDG9iWN+OiSdIySrZC1TMQuc5Ks1B nBDg== X-Gm-Message-State: AA+aEWbcMjQ/mXJpMusMQM2/bKdtEnm5nnNV+j4jIvI9tScR6idZgnMc 4z09Z97R+5ifsKp26YOsiGcWj7lUUoM= X-Google-Smtp-Source: AFSGD/UOifFDnvRfNi0SxdjVBi403RuKY1dM3CB2s5Z6LuBFqwwTeNQ6AkiKKoUINkT/fAEXojQ8dw== X-Received: by 2002:a17:902:541:: with SMTP id 59mr22450519plf.88.1543966714050; Tue, 04 Dec 2018 15:38:34 -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.38.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 15:38:33 -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 25/26] aio: split old ring complete out from aio_complete() Date: Tue, 4 Dec 2018 16:37:28 -0700 Message-Id: <20181204233729.26776-26-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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jens Axboe --- fs/aio.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 1c8a8bb631a9..39aaffd6d436 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1218,12 +1218,9 @@ static void aio_fill_event(struct io_event *ev, struct aio_kiocb *iocb, ev->res2 = res2; } -/* aio_complete - * Called when the io request on the given iocb is complete. - */ -static void aio_complete(struct aio_kiocb *iocb, long res, long res2) +static void aio_ring_complete(struct kioctx *ctx, struct aio_kiocb *iocb, + long res, long res2) { - struct kioctx *ctx = iocb->ki_ctx; struct aio_ring *ring; struct io_event *ev_page, *event; unsigned tail, pos, head; @@ -1273,6 +1270,16 @@ static void aio_complete(struct aio_kiocb *iocb, long res, long res2) spin_unlock_irqrestore(&ctx->completion_lock, flags); pr_debug("added to ring %p at [%u]\n", iocb, tail); +} + +/* aio_complete + * Called when the io request on the given iocb is complete. + */ +static void aio_complete(struct aio_kiocb *iocb, long res, long res2) +{ + struct kioctx *ctx = iocb->ki_ctx; + + aio_ring_complete(ctx, iocb, res, res2); /* * Check if the user asked us to deliver the result through an