Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10389576rwp; Thu, 20 Jul 2023 21:01:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgAjBAaldksZ/IE9r7J6f6rbqDbB59CMbT7EKQibaOeEBLEMnHziUU0PB93utyfCPHMJRL X-Received: by 2002:a05:6a20:ba8a:b0:131:39cc:4c21 with SMTP id fb10-20020a056a20ba8a00b0013139cc4c21mr610598pzb.56.1689912103212; Thu, 20 Jul 2023 21:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689912103; cv=none; d=google.com; s=arc-20160816; b=RoNgZ8pqe/4hX6JAexkiXt6v+O2iZLeHl2WRaAlPjNOYDB/hlvTfBOnNEOJFqYhNuR 9ab57ehBXehnTnFAkJuhTi1KUhGqomuLOWxFT8599MEcNpkPtkSO0IEInubODFD/Wz9S zgAIqxjTpZNE0+6hvxW8UsDQNbhjscsrayCvrXcnQMQYLkQyfoaQCptitFdbHHvaPHGv 2DHkdq1XLOuBhCTJqxZB6JAhz8ygWvXUE1ZXWOKpqnRQBpIs+ZbgY7YWuNCZzh6c79wS /uaLVGPo3vDbVsgQTLJpREIsBxTE9yCwNalBRdj14l0ZGDLJ5vYUSsvkutyOcLSPqoHa cgWg== 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=2wILzb2wdzx6gb3QQe8NCuw5mHGSyWx+uSmLft9oKJA=; fh=q8rOnvZaN5Z50YvgZS1uBArX5ZcEEwPcusRFazgmNUQ=; b=VU82ms8EcyOoJ6XIfyTJzdHVcY39DDeQHThHJ3V6hjn9gj/Wry92wQKBEEWQbrHHXg l9/fDMePqmHMcgyB/aHokIXuL37s6lJG5wNxMkY1fLKYif+dPvtABEHa05cjVO/ImKBu IuNABRKQXNTWJyRmGNUom2uvlvoCRpvWE1wgYhO2ty1l+jv1PguIW6kb9E2El9E1HfKh BCVcQvjAg54kxGHE0G6dByRIFmaQkNUjSWJJRmvmjZWClYiLt2yb1CSvyvgOGNNbNIt2 /nejGIqM/6DzmOy7RXsVmh1d+rGk2O4sbgitY4QdxC7tgL0a6ZQROU9RYH+kGdsOs6bI LHuQ== 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 x35-20020a056a0018a300b006749ad285e8si2315791pfh.97.2023.07.20.21.01.30; Thu, 20 Jul 2023 21:01:43 -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 S229813AbjGUDpY (ORCPT + 99 others); Thu, 20 Jul 2023 23:45:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230053AbjGUDpO (ORCPT ); Thu, 20 Jul 2023 23:45:14 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F251BFC for ; Thu, 20 Jul 2023 20:45:13 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R6b4x0PtvzVjnQ; Fri, 21 Jul 2023 11:43:45 +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:10 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v4 04/10] mm/page_io: use a folio in __end_swap_bio_write() Date: Fri, 21 Jul 2023 11:44:45 +0800 Message-ID: <20230721034451.16412-5-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 two implicit call to compound_head(). Signed-off-by: ZhangPeng --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 5ddb5d9c5013..d9f5fa5b7281 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -29,7 +29,7 @@ static void __end_swap_bio_write(struct bio *bio) { - struct page *page = bio_first_page_all(bio); + struct folio *folio = bio_first_folio_all(bio); if (bio->bi_status) { /* @@ -40,13 +40,13 @@ static void __end_swap_bio_write(struct bio *bio) * * Also clear PG_reclaim to avoid folio_rotate_reclaimable() */ - set_page_dirty(page); + folio_mark_dirty(folio); pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n", MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); - ClearPageReclaim(page); + folio_clear_reclaim(folio); } - end_page_writeback(page); + folio_end_writeback(folio); } static void end_swap_bio_write(struct bio *bio) -- 2.25.1