Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9539062rwp; Thu, 20 Jul 2023 06:29:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsGL6hX13Y29HwERjWsz652jwGt1r7BR/fjJBzn+CJstXHUht53L0tlUcEPOAG6vuLErka X-Received: by 2002:a05:6a00:24d5:b0:686:24e1:d12e with SMTP id d21-20020a056a0024d500b0068624e1d12emr8117067pfv.30.1689859794616; Thu, 20 Jul 2023 06:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689859794; cv=none; d=google.com; s=arc-20160816; b=wnk7c42i6XT00ZTEEHBeL3dXET8vnn8aYFYRbChKIaq36bcRuh3sejPfEre4bLuG9z ORa2BzyUxIovOOTc9pGAlnu8oKqHKv40TqfHwMxnzWZRzDmtQaPeaUwcGESsvdwU9xL4 qmFSFG4EJIZr+m1eEmjvX1rIBaF5koQceK2xWeks4TpvIOqsvBHlZTRZLoenXpiAcWlU rx2ZZI89a99USZNh/pZp41H4jM3n5dumyyLBfR52bQ+nVXW/pc0LTMRCLwi//sPcDeMT JEBpZBBFkePw1i68DTN+VaWzxb/9a7I/EzsWNrDfLGe7Y0r9TJxUKjoQ/uLNF9S9jMrE dhrA== 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=UIF1/RDQxGiWQWtgFqv/0f1S/VSRVZSzWjrR6f+CKz4=; fh=q8rOnvZaN5Z50YvgZS1uBArX5ZcEEwPcusRFazgmNUQ=; b=YuUvfcrp2S6sKY8v5OK1HJRwEMq+/fmB6fXLfP3GKwHVgZoBPE2SdTfLTkcnNOsdn7 n1FBA842snrBIqG5PbfI4hdIJXh5cCY10uxYxAqFGB79DEjYR6C/jPrtmP/KASZmHGhJ fY9ocUdBN3Ewa7o9e9u+5DTq7zyTsh/LAOEfJM03DJIW5Zs6isP/DyO+myqYuhxL5Hka /84m+S3WyIJxnv9fa8a4HkODGw5tDQ45m/9dBAb9YGfjKVqoSBqjveI2sctbFd7QwEba QxkkmjRoWBs6i+aEXOQ+/nG/bL6LMU5IaznVfLR6ECyk2OKA8mp3P29l6xCp3xNexp5k Eczw== 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 g17-20020a056a0023d100b00675807330basi950692pfc.206.2023.07.20.06.29.41; Thu, 20 Jul 2023 06:29:54 -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 S231562AbjGTNCa (ORCPT + 99 others); Thu, 20 Jul 2023 09:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231341AbjGTNCW (ORCPT ); Thu, 20 Jul 2023 09:02:22 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E4110D2 for ; Thu, 20 Jul 2023 06:02:21 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R6CS30yXYzNmVt; Thu, 20 Jul 2023 20:58:59 +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; Thu, 20 Jul 2023 21:02:18 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v3 06/10] mm/page_io: use a folio in sio_read_complete() Date: Thu, 20 Jul 2023 21:01:43 +0800 Message-ID: <20230720130147.4071649-7-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720130147.4071649-1-zhangpeng362@huawei.com> References: <20230720130147.4071649-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 3b97289153f9..7e7a9f67b9ad 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