Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10421285rwp; Thu, 20 Jul 2023 21:47:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4RXP0nAIIYQP5x4lOpZ/NgY1kF6pzcPvXU6UvNuOJdrgBa4yxtYsey7Q+O9ddYq8QYh1U X-Received: by 2002:a50:fa8d:0:b0:51d:a02d:f8fe with SMTP id w13-20020a50fa8d000000b0051da02df8femr640093edr.29.1689914819938; Thu, 20 Jul 2023 21:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689914819; cv=none; d=google.com; s=arc-20160816; b=Zbn/0gtOKWADSssFkCoLt0NA1SvDjgFEUw6NUxYB/fqt2Q0aMvbczjtUeZuRhBVTPW Vmamygog1fFwqVUcGxoN60GBiQIHQnAidiNV8+IdWwQfVv4DCjAERnt8KV4luLiphm43 TKNwFGHBwRxj6OZrnmpYw6myD3lumYF31W/dq+LmzxcVk9HtC70XQ9WhEzLflb9RrrST GOSgrHByBrT1oAWgm8xZjn4yaSz5T45Ac5g3YFG90ViBGk3jpgAnWJoyjjg884V9jv5v B2REAoDQTXRXLyP62i0JNphgdk+KLP3GHIkl/XsqtnM2e2Ms2/O62812jb9PTz76BRVM /BBg== 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=WqQWK9TsEa8n0IcR2BJHT3IJcd/+xSCOCRgF0IuUpS1h/GEwxdvXA8hl6byG0KyP8J mOUh77N32AXImOubf02DIKuJ0bTQ74P52Of20OiQLq4y1yV4mCZ+v5Pcb2JUDCyJCUfy EcQyocBctyUSNKGcTLEBaHfaChM2FLim+wAilFJFQCJA+OGv/Dz+FPv2ZLj1FreFI6qn ITk3jItV7pOiEKzBowbJXmoamQaTxoUNvJuKD/GI5ALqbI+WDZzV6FS+hNa0NM5UNd6n E6GPsLKOyWobX23bwj7taz7zUQauC9/zmIZriwbT1egzDmyIejwXjQ1Jf4ToLfVsbMNz iPfw== 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 t8-20020a05640203c800b0051e065bbc1dsi1860184edw.36.2023.07.20.21.46.35; Thu, 20 Jul 2023 21:46:59 -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 S230166AbjGUDpe (ORCPT + 99 others); Thu, 20 Jul 2023 23:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbjGUDpQ (ORCPT ); Thu, 20 Jul 2023 23:45:16 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2179F272C for ; Thu, 20 Jul 2023 20:45:15 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R6b5j6SfrzrRqs; Fri, 21 Jul 2023 11:44:25 +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; Fri, 21 Jul 2023 11:45:11 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v4 06/10] mm/page_io: use a folio in sio_read_complete() Date: Fri, 21 Jul 2023 11:44:47 +0800 Message-ID: <20230721034451.16412-7-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230721034451.16412-1-zhangpeng362@huawei.com> References: <20230721034451.16412-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: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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