Message ID | 20230315123233.121593-3-p.raghav@samsung.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2320157wrd; Wed, 15 Mar 2023 06:11:41 -0700 (PDT) X-Google-Smtp-Source: AK7set/zvWWYGGVX68dt+DKJmLBP8jYPIW1WB/DfHYIfdJIJW4GPMF0U6Z/KiArV5rVlMPJeVGUV X-Received: by 2002:a17:90b:3112:b0:23b:4bf6:bbed with SMTP id gc18-20020a17090b311200b0023b4bf6bbedmr13256794pjb.24.1678885901076; Wed, 15 Mar 2023 06:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678885901; cv=none; d=google.com; s=arc-20160816; b=RKR71FB3NOrzgwb+kWa4AGjRaduFSxXLDNcAeer2zcnXBFAy+6h8fY6xgmP4mrd/jl BLzK717J1Fjt8MrDhnzQjY2kzcBFGwMIA4sa2fCZQoKZDQh4IWgbSbWt48XTNo1ZPV+Z JoCArgOZu3iRg057dPft2YO0RjiM1PUg/PR2opH39Pbm8pKziROrnGvN8pQKFMnIuB89 7OSGgcZ32DiDofjbcxNUD+rHI9EeQ5dRHxdPb34pFFCJFtsNpRvXrbq9ip3gXqtN9ZdJ TyS/JKbg56i/0pLj+69j0fA0RNjq0WMm58wGCnEJzVd1+RYI0FprTUZ7H2dTW1DQzlzz XkRw== 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=xHtHdDL6PMtjzG/s1BTeKZDoZWNicuamGwZqbWGaFWY=; b=K9ohorTC37Nt6dz8SJArb0uB/FQfuc4O91xwODXnED5bs5KLJmh6SxVqA1OLPcd7MZ qK5x8sbZ1/ZLnFFKpRWou/V9IdZtF3HPbti2i88NA7q0rYWuA98uLnpqT1SRnDZCWgU7 UhZnbvtYle+Yw80zMuen+a6FA82IW2vMl+3TEvZu6y4NToyOAFGYFcsQXu7pkNayNmT0 K7H0GmhSZI2ok0tsGXusnRCpmqY7fBTuog0qQwxkSWVhH7/r5BBKXRfXhxTW4Qcwe89P +9aXtvwcYAZlWnFxjyEe3lL0oHDQ/Uu6fENLN6qwQtMcBI35H+g1CSBVs5jKYAlsHNUF f64g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ax8djDHz; 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 z128-20020a636586000000b00502e7406695si4995637pgb.316.2023.03.15.06.11.26; Wed, 15 Mar 2023 06:11:41 -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=ax8djDHz; 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 S232675AbjCOMeW (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Wed, 15 Mar 2023 08:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232681AbjCOMeB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Mar 2023 08:34:01 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924449FBE7 for <linux-kernel@vger.kernel.org>; Wed, 15 Mar 2023 05:32:45 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230315123237euoutp015a333b38429455bc8300ece982d4917c~Ml7NTDwVE2632426324euoutp01H for <linux-kernel@vger.kernel.org>; Wed, 15 Mar 2023 12:32:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230315123237euoutp015a333b38429455bc8300ece982d4917c~Ml7NTDwVE2632426324euoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1678883557; bh=xHtHdDL6PMtjzG/s1BTeKZDoZWNicuamGwZqbWGaFWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ax8djDHzSaL2h5KoBK8rAqoscnHFdpLvekOgdxRLNhFJdvc1CU+XEdZujT1yApZJr kHnV6wwVOwl4uP6Di2aFvMjU0yWRB0/YRhHvWMJMkZU4PxscvptOypNRqC1/Oq5eG0 I+iCVezVB6IDbnkfc2g2QIEUb7Cipw9xnaVVF8sE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230315123236eucas1p278affb4e64241546f64afed338efca1c~Ml7L6vXGB3026530265eucas1p21; Wed, 15 Mar 2023 12:32:36 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 4F.70.09503.3EAB1146; Wed, 15 Mar 2023 12:32:35 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230315123235eucas1p1bd62cb2aab435727880769f2e57624fd~Ml7LeOs-D2051320513eucas1p16; Wed, 15 Mar 2023 12:32:35 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230315123235eusmtrp1bdff96dbbe94408780a8ff5c68ddbd05~Ml7LdnDW41056310563eusmtrp1z; Wed, 15 Mar 2023 12:32:35 +0000 (GMT) X-AuditID: cbfec7f2-ea5ff7000000251f-1e-6411bae38811 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AF.AF.09583.3EAB1146; Wed, 15 Mar 2023 12:32:35 +0000 (GMT) Received: from localhost (unknown [106.210.248.172]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230315123235eusmtip2887f4bfaca2837bb071b662d96499d3a~Ml7LNopEC0183701837eusmtip2L; Wed, 15 Mar 2023 12:32:35 +0000 (GMT) From: Pankaj Raghav <p.raghav@samsung.com> To: hubcap@omnibond.com, senozhatsky@chromium.org, martin@omnibond.com, willy@infradead.org, minchan@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, axboe@kernel.dk, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, gost.dev@samsung.com, mcgrof@kernel.org, devel@lists.orangefs.org, Pankaj Raghav <p.raghav@samsung.com> Subject: [RFC PATCH 2/3] mpage: use bio_for_each_folio_all in mpage_end_io() Date: Wed, 15 Mar 2023 13:32:32 +0100 Message-Id: <20230315123233.121593-3-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230315123233.121593-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLKsWRmVeSWpSXmKPExsWy7djP87qPdwmmGGzdY2ExZ/0aNovVd/vZ LF4f/sRosX/zFCaLmwd2Mlm03+1jsth7S9tiz96TLBaXd81hs7i35j+rxcn1/5ktbkx4ymix 7Ot7dovPS1vYLXZ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bGfobssDRT3MXttu9YQlDthWWXUlftH9nje4X3DIdnk 76vPyjurtO5ChbB54b1Zt5RYijMSDbWYi4oTARrtJ/1gAwAA X-CMS-MailID: 20230315123235eucas1p1bd62cb2aab435727880769f2e57624fd X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20230315123235eucas1p1bd62cb2aab435727880769f2e57624fd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230315123235eucas1p1bd62cb2aab435727880769f2e57624fd References: <20230315123233.121593-1-p.raghav@samsung.com> <CGME20230315123235eucas1p1bd62cb2aab435727880769f2e57624fd@eucas1p1.samsung.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,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, URIBL_BLOCKED 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?1760439462392125652?= X-GMAIL-MSGID: =?utf-8?q?1760439462392125652?= |
Series |
convert page_endio to folio_endio
|
|
Commit Message
Pankaj Raghav
March 15, 2023, 12:32 p.m. UTC
Use bio_for_each_folio_all to iterate through folios in a bio so that
the folios can be directly passed to the folio_endio() function.
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
fs/mpage.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
Comments
On Wed, Mar 15, 2023 at 01:32:32PM +0100, Pankaj Raghav wrote: > Use bio_for_each_folio_all to iterate through folios in a bio so that > the folios can be directly passed to the folio_endio() function. > > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Luis
On 3/15/23 13:32, Pankaj Raghav wrote: > Use bio_for_each_folio_all to iterate through folios in a bio so that > the folios can be directly passed to the folio_endio() function. > > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> > --- > fs/mpage.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/fs/mpage.c b/fs/mpage.c > index 40e86e839e77..bfcc139938a8 100644 > --- a/fs/mpage.c > +++ b/fs/mpage.c > @@ -45,14 +45,11 @@ > */ > static void mpage_end_io(struct bio *bio) > { > - struct bio_vec *bv; > - struct bvec_iter_all iter_all; > + struct folio_iter fi; > > - bio_for_each_segment_all(bv, bio, iter_all) { > - struct page *page = bv->bv_page; > - folio_endio(page_folio(page), bio_op(bio), > - blk_status_to_errno(bio->bi_status)); > - } > + bio_for_each_folio_all(fi, bio) > + folio_endio(fi.folio, bio_op(bio), > + blk_status_to_errno(bio->bi_status)); > > bio_put(bio); > } Ah. Here it is. I would suggest merge these two patches. Cheers, Hannes
On Wed, Mar 15, 2023 at 03:52:15PM +0100, Hannes Reinecke wrote: > On 3/15/23 13:32, Pankaj Raghav wrote: > > Use bio_for_each_folio_all to iterate through folios in a bio so that > > the folios can be directly passed to the folio_endio() function. > > + bio_for_each_folio_all(fi, bio) > > + folio_endio(fi.folio, bio_op(bio), > > + blk_status_to_errno(bio->bi_status)); > > bio_put(bio); > > } > > Ah. Here it is. > > I would suggest merge these two patches. The right way to have handled this patch series was: 1. Introduce a new folio_endio() [but see Christoph's mail on why we shouldn't do that] 2-n convert callers to use folios directly n+1 remove page_endio() entirely. Note that patch n+1 might not be part of this patch series; sometimes it takes a while to convert all callers to use folios. I very much dislike the way this was done by pushing the page_folio() call into each of the callers because it makes the entire series hard to review.
On 2023-03-15 17:08, Matthew Wilcox wrote: > On Wed, Mar 15, 2023 at 03:52:15PM +0100, Hannes Reinecke wrote: >> On 3/15/23 13:32, Pankaj Raghav wrote: >>> Use bio_for_each_folio_all to iterate through folios in a bio so that >>> the folios can be directly passed to the folio_endio() function. >>> + bio_for_each_folio_all(fi, bio) >>> + folio_endio(fi.folio, bio_op(bio), >>> + blk_status_to_errno(bio->bi_status)); >>> bio_put(bio); >>> } >> >> Ah. Here it is. >> >> I would suggest merge these two patches. > > The right way to have handled this patch series was: > > 1. Introduce a new folio_endio() [but see Christoph's mail on why we > shouldn't do that] > 2-n convert callers to use folios directly > n+1 remove page_endio() entirely. > > Note that patch n+1 might not be part of this patch series; sometimes > it takes a while to convert all callers to use folios. > This is definitely a much better way to handle these changes. Thanks willy. > I very much dislike the way this was done by pushing the page_folio() > call into each of the callers because it makes the entire series hard to > review.
diff --git a/fs/mpage.c b/fs/mpage.c index 40e86e839e77..bfcc139938a8 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -45,14 +45,11 @@ */ static void mpage_end_io(struct bio *bio) { - struct bio_vec *bv; - struct bvec_iter_all iter_all; + struct folio_iter fi; - bio_for_each_segment_all(bv, bio, iter_all) { - struct page *page = bv->bv_page; - folio_endio(page_folio(page), bio_op(bio), - blk_status_to_errno(bio->bi_status)); - } + bio_for_each_folio_all(fi, bio) + folio_endio(fi.folio, bio_op(bio), + blk_status_to_errno(bio->bi_status)); bio_put(bio); }