Message ID | 20230403132221.94921-4-p.raghav@samsung.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2300775vqo; Mon, 3 Apr 2023 06:26:17 -0700 (PDT) X-Google-Smtp-Source: AKy350bbmS8jrushWhN/LbBGa5RQNXjECig9M5O+hLzuD18W+EwL7oRd7Yqdi3uJQfsPB4DiKjcV X-Received: by 2002:a17:906:36d7:b0:93d:cffb:80ba with SMTP id b23-20020a17090636d700b0093dcffb80bamr36193729ejc.66.1680528376896; Mon, 03 Apr 2023 06:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680528376; cv=none; d=google.com; s=arc-20160816; b=LtjTjBpNRNbUCPCyVv9wLCkDJivvlwMQmQ36QV7ZhWehAx2I0jRofTkelGSEgQXgPk leVmcLI3xBf8lEQHtR1klu93R/S5VJv+UUgy8gsISAVH3jDX79cNm4vvwYU6vSELw+oE zdM1PQrheqnQYuqwa9yqfsqInef91JoOANO31TLeIsRnCGkTh0PljxsAdwJWKKxHtoqQ K5q5J+HbSZERE6pFfhawC+dudzzlQY3sX62QCaME0eK1MDvqVSE+/Ds8en6VnAnY+SYJ eJjV6mOcca1Wcm9vHFINNtFaiKTdQSDOZtVpteUvuvZMBil9m1I8MscUkjWcA8BQOhvP MpQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; b=GJWEA5PjSEVU4Ixy8YE83oY4qQGZqJMne5595ZZmstQLqaIdUAyNICGaaMlIeO9z/d dBSonpbcRZxaEnVP+Jo5B/rI6Ij2kzSYQO5VX3ujCrcKc/hPEwvEFBcpTOI9vtrY449Y d9bu/hbEXp3bPVXTt9vJeI3/6Frx5bMCzYjPu+rSse9hL/pTAgoNV2l0Q537xg9h80or LDcCjVeLne0KsaqIaVSBEUofPEk0LI6MR5VjDKnZo4wEhd5pgX+5VovXYW5nrOtVprUP t6WBhO5+IhKav3RieWNk/1SdQa+cq56OV5h+luZ8c4Yo6KdX28h39eMDOllVacqWf18L l7hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=r++2oaFN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t9-20020a1709066bc900b0093b6e1440b3si3343222ejs.764.2023.04.03.06.25.52; Mon, 03 Apr 2023 06:26:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=r++2oaFN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232386AbjDCNWd (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 3 Apr 2023 09:22:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbjDCNWa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 09:22:30 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27A41B75A for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 06:22:28 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132226euoutp02c689b2599ea99258d6f9960699146eaf~Sb3IdslyA1374413744euoutp02x for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230403132226euoutp02c689b2599ea99258d6f9960699146eaf~Sb3IdslyA1374413744euoutp02x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528146; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r++2oaFN0N0+G2S72qO8e7Cw6GtX3TD1d5DuTTMDG1WzMvdZZCbjPPf5CdK/g82XQ 0i0Ws6YK2Ki8ER/EpnURSfsgnkLG91B92CBR6PYPIK182Btxcn7MN6l0oov3BfAmk7 IcYiJhbCpv60tSR/+MHwNvetQdvPDop0fg+0ibg4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230403132225eucas1p2eeb69651b019e4e779166e8b360a7342~Sb3HE0Gyc2688526885eucas1p2X; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2B.F4.09503.113DA246; Mon, 3 Apr 2023 14:22:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169~Sb3Gsa2HH2688526885eucas1p2W; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230403132224eusmtrp2025b29c3cb119969b17b4113d6677db0~Sb3GrwLJb0200802008eusmtrp2L; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-b4-642ad311da86 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7E.16.08862.013DA246; Mon, 3 Apr 2023 14:22:24 +0100 (BST) Received: from localhost (unknown [106.210.248.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230403132224eusmtip14497bed1922f57dfc44ffe4d39a2dff3~Sb3Ge5UWK2612826128eusmtip1B; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) From: Pankaj Raghav <p.raghav@samsung.com> To: axboe@kernel.dk, minchan@kernel.org, martin@omnibond.com, hubcap@omnibond.com, brauner@kernel.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, akpm@linux-foundation.org, willy@infradead.org, hch@lst.de Cc: devel@lists.orangefs.org, mcgrof@kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-fsdevel@vger.kernel.org, Pankaj Raghav <p.raghav@samsung.com> Subject: [PATCH v2 3/5] mpage: split bi_end_io callback for reads and writes Date: Mon, 3 Apr 2023 15:22:19 +0200 Message-Id: <20230403132221.94921-4-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403132221.94921-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7djP87qCl7VSDDY8F7aYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8Wyr+/Z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2svtd29rER18jeKPUr7rHz4qI 7eo6u9DzoXNJY4nbHb8dp0+ufJif+Xx3rBJLcUaioRZzUXEiAM3/pTloAwAA X-CMS-MailID: 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169 References: <20230403132221.94921-1-p.raghav@samsung.com> <CGME20230403132224eucas1p21fd296fbd4af70220331bb19023f4169@eucas1p2.samsung.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762161723663563912?= X-GMAIL-MSGID: =?utf-8?q?1762161723663563912?= |
Series |
remove page_endio()
|
|
Commit Message
Pankaj Raghav
April 3, 2023, 1:22 p.m. UTC
Split the bi_end_io handler for reads and writes similar to other aops.
This is a prep patch before we convert end_io handlers to use folios.
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
fs/mpage.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
Comments
> struct page *page = bv->bv_page; > - page_endio(page, bio_op(bio), > + page_endio(page, REQ_OP_READ, > + blk_status_to_errno(bio->bi_status)); Nit: I think we can do without the page local variable here. > + bio_for_each_segment_all(bv, bio, iter_all) { > + struct page *page = bv->bv_page; > + page_endio(page, REQ_OP_WRITE, > blk_status_to_errno(bio->bi_status)); Same here. > } > > @@ -59,7 +73,11 @@ static void mpage_end_io(struct bio *bio) > > static struct bio *mpage_bio_submit(struct bio *bio) > { > - bio->bi_end_io = mpage_end_io; > + if (op_is_write(bio_op(bio))) > + bio->bi_end_io = mpage_write_end_io; > + else > + bio->bi_end_io = mpage_read_end_io; > + I'd also split mpage_bio_submit as all allers are clearly either for reads or writes.
diff --git a/fs/mpage.c b/fs/mpage.c index 22b9de5ddd68..3a545bf0f184 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -43,14 +43,28 @@ * status of that page is hard. See end_buffer_async_read() for the details. * There is no point in duplicating all that complexity. */ -static void mpage_end_io(struct bio *bio) +static void mpage_read_end_io(struct bio *bio) { struct bio_vec *bv; struct bvec_iter_all iter_all; bio_for_each_segment_all(bv, bio, iter_all) { struct page *page = bv->bv_page; - page_endio(page, bio_op(bio), + page_endio(page, REQ_OP_READ, + blk_status_to_errno(bio->bi_status)); + } + + bio_put(bio); +} + +static void mpage_write_end_io(struct bio *bio) +{ + struct bio_vec *bv; + struct bvec_iter_all iter_all; + + bio_for_each_segment_all(bv, bio, iter_all) { + struct page *page = bv->bv_page; + page_endio(page, REQ_OP_WRITE, blk_status_to_errno(bio->bi_status)); } @@ -59,7 +73,11 @@ static void mpage_end_io(struct bio *bio) static struct bio *mpage_bio_submit(struct bio *bio) { - bio->bi_end_io = mpage_end_io; + if (op_is_write(bio_op(bio))) + bio->bi_end_io = mpage_write_end_io; + else + bio->bi_end_io = mpage_read_end_io; + guard_bio_eod(bio); submit_bio(bio); return NULL;