Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7958932rwp; Wed, 19 Jul 2023 03:06:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7EjAphFYM4U/XJ4PaNNJD0uxE8729S1kWsSjwvOR/LcLGzVeXC29fT6JsmrpKFs+7+xSm X-Received: by 2002:a17:906:109b:b0:98d:63c5:d147 with SMTP id u27-20020a170906109b00b0098d63c5d147mr2097039eju.47.1689761193641; Wed, 19 Jul 2023 03:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689761193; cv=none; d=google.com; s=arc-20160816; b=jP4TU6EY6IncRC0n2VCCds6QGh99ESLF6AD/UPyHCVyuyaJgyKAKMCEnAxL7WsrKSH YaY5Lqf8raJTmPphnxN+soSK/U2v1kGjw/WMZfpoZ3iE9V3Z+91luDSP3BQQZ5wVRbuN 48gT2SNDW2ZkXu6iPB1m5TANt+UK0LkUElf6dfU7RgQfw/VNWESR4L8ogrxGxJtbiY4F PnVP1DKxAvgvMj13DnnFggY5FsF4KsCI8OJZUvWCa02XkbdkGkdkpWhi5Yck5GCee4Eh uKvCi8LxoRyBusCTd7wEN256pFEcL7BDaAvil0pv7PQQCX+JrpG9Lm16snqwSsPi2y4w DNkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7iJ8RQalvU29tR6/0DVQL0+l89i13Wo4PPDJ7dZu1gI=; fh=fQ8bSAglEIUMWaW8g2fbwjC8kqQICqHTc4sMCYJe224=; b=JfkkKktBWFYybadSKbo5cwRyNBg0IX3ieaxNA50NEnQ7ZyNkNVojnBPyUvIPU2tcpM wgYEMNDGA9CZNBuHSKiTWUPKrkrwe45pdEM9i3RejIhM/d77v2On2HwK/07cVideFJ9s OhEc3iTe4JQAWZ6kwxMeZ41OfWN4d3xomaEH8PzhiXTF5K/sowiJoqb3XfYJzNyzS7ge k4EAVdrn8zG2erI/gjREBI2vB6+j2ZIo3wotOrQNhI5j8TQmtLtFuusmiAttfsAR/kgU kcHS8A/hCbpF8541HI9xyjFRrlKGt4wvao+sNgfVUQ7DeyMpgWdrj1ZQyXjyWL0lqPSG lFkw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a170906254900b00993860a6d3csi2544171ejb.81.2023.07.19.03.06.08; Wed, 19 Jul 2023 03:06:33 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbjGSJ7d (ORCPT + 99 others); Wed, 19 Jul 2023 05:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbjGSJ7A (ORCPT ); Wed, 19 Jul 2023 05:59:00 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 898911715 for ; Wed, 19 Jul 2023 02:58:59 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R5WRC0MkCztQlV; Wed, 19 Jul 2023 17:55:51 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 17:58:57 +0800 From: Peng Zhang To: , , CC: , , , , ZhangPeng Subject: [PATCH v2 5/9] mm/page_io: use a folio in sio_read_complete() Date: Wed, 19 Jul 2023 17:58:44 +0800 Message-ID: <20230719095848.3422629-6-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230719095848.3422629-1-zhangpeng362@huawei.com> References: <20230719095848.3422629-1-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org From: ZhangPeng Saves one implicit call to compound_head(). Signed-off-by: ZhangPeng --- mm/page_io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 6520687bd282..92f21f380ee8 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret) if (ret == sio->len) { for (p = 0; p < sio->pages; p++) { - struct page *page = sio->bvec[p].bv_page; + struct folio *folio = page_folio(sio->bvec[p].bv_page); - SetPageUptodate(page); - unlock_page(page); + folio_mark_uptodate(folio); + folio_unlock(folio); } count_vm_events(PSWPIN, sio->pages); } else { for (p = 0; p < sio->pages; p++) { - struct page *page = sio->bvec[p].bv_page; + struct folio *folio = page_folio(sio->bvec[p].bv_page); - unlock_page(page); + folio_unlock(folio); } pr_alert_ratelimited("Read-error on swap-device\n"); } -- 2.25.1