Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10421438rwp; Thu, 20 Jul 2023 21:47:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHluHtqrLLG+5dMupD1xplkAZmkdcP8ug7m1mVO2fbHARL84cYdEl6fhIXTZX7/LqRZqRYo X-Received: by 2002:a17:906:3298:b0:993:eddd:6df4 with SMTP id 24-20020a170906329800b00993eddd6df4mr657596ejw.10.1689914832496; Thu, 20 Jul 2023 21:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689914832; cv=none; d=google.com; s=arc-20160816; b=ornST137WKJxClESrsAVRJkdk+mvAs1qf0ZwJMmrhxqjlviStKjdfv6fxVgdjAApWh 9V6AOwkd9dxU7BNwxr1oJwrYI/DKACShl1atgeVPG6n9QwB/5ATT5POZI/VLVZylfuBd 8B/vs1oDTqUuk2hyaGVZPXqZ70VrSGV1svw5YqhvOsxjgOwo3Lu0ah/6f+DiWs1SQufE ZkljptQDQH3qokqt0NqeC6pUE7vdBYPUVX0QayWQg2/dhjIt4Byj8U6FQTwBicu70Pj+ LDptgLL6pO9cAYzHUAQhrBcT04V4HJTH6FLgDc3JWb21RVU4L71Zlwlbg0HypzSNQceJ 8eCQ== 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=CB+qHE2AIiaz5vX2bP273n+UcyM/xFYJgaKztaFkiuE=; fh=q8rOnvZaN5Z50YvgZS1uBArX5ZcEEwPcusRFazgmNUQ=; b=k/329i5JMvaQeFYEBgTqFhaixXtYmHZnMM+0d01WgDAfgK7Rk/mfCd3Dc5hIJAsEse pG820VOfbqJptvZUf4c3jXGRu8gGTpgvonf1K4uNVJULk/fuQqwbAgc+x91wljfI7Kov guMAWgv+9xHGPKvpBY4aejhIs4QO2j+mstzvFYoA0h/T3TV3DVWERJ2YmKVf0DPeRDS0 Uq8Wn1Ve2yrDiR/mNLow/8+pPNUc95BpwCKXiG+J9GAaibJaVj/G4k3j8DeE5DuudFkU vhNL16rexy7f+bQtKVQILSiLHGBpwzOOL+pILoy5X5P5nvuRjh2OakMMojs4exaK3WXk wbTg== 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 h12-20020a170906398c00b00993150ec3c7si1730135eje.966.2023.07.20.21.46.48; Thu, 20 Jul 2023 21:47:12 -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 S229884AbjGUDp1 (ORCPT + 99 others); Thu, 20 Jul 2023 23:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbjGUDpO (ORCPT ); Thu, 20 Jul 2023 23:45:14 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4FC02729 for ; Thu, 20 Jul 2023 20:45:13 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R6b2z22NLztRRT; Fri, 21 Jul 2023 11:42:03 +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 05/10] mm/page_io: use a folio in __end_swap_bio_read() Date: Fri, 21 Jul 2023 11:44:46 +0800 Message-ID: <20230721034451.16412-6-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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index d9f5fa5b7281..3b97289153f9 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -57,16 +57,16 @@ static void end_swap_bio_write(struct bio *bio) static void __end_swap_bio_read(struct bio *bio) { - struct page *page = bio_first_page_all(bio); + struct folio *folio = bio_first_folio_all(bio); if (bio->bi_status) { pr_alert_ratelimited("Read-error on swap-device (%u:%u:%llu)\n", MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); } else { - SetPageUptodate(page); + folio_mark_uptodate(folio); } - unlock_page(page); + folio_unlock(folio); } static void end_swap_bio_read(struct bio *bio) -- 2.25.1