Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp145935pxv; Thu, 15 Jul 2021 00:50:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznW0eY5WSFTcNHABMcOucyFvSsKJX3QXXzjQ1kiB9gQxvPO+f4rIQ1vEI0baniBNo83Fz+ X-Received: by 2002:a17:906:8252:: with SMTP id f18mr3937828ejx.261.1626335423731; Thu, 15 Jul 2021 00:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626335423; cv=none; d=google.com; s=arc-20160816; b=A2GY/5/FI/0jbiYnRCGZtRILTwansTmOHiuY5rBqsLZVE+ZTNow+v73NJc/ed0SobI 4cnZIoeHYy1id6Jn8+AhyV1xpDR0b4pMt/c+MpZFXFIF50IMZLWODbBnZ+Gj9kRMS1ek OJjYHEQ6mChk3HCwNbB3KmX3vOIQumUxgIlNsTo6CMsJetBmgRimfI6QL4f1QdDTvePv 3NopAk5LSyBTn2UEYWeneXbGcIykt9LgCoohEmOCCruo1pYOJ5DzlGb97X4dT3gDc4/V 0G6TpE2m1ftoh5zDntLTIfIdV1S9jhh2yzYldA2eIigx5l8hdoKu3s3QgufMuGyOe7bD lRvQ== 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 :dkim-signature; bh=c36GOq3ah392G52Mqq66mFAtLZcpjZrfdzLMICjvPFs=; b=tsYPFmPKTbtjN8D7j3lUXS4xdka4yyiM4Eny8sf4p8YUGY8z9jMUCy36Tnd7IUVCzw tgtgV+lT59W5npHRjCR1jZYfGAICOUvlgk/H90vP0ABTRmdGcqlEjFJBpTcd7pYVacwY 3um7wQ5GjpAWPzQRNjp68PuatRCsHRiG8XErujXTUeiGr8HXEYhBhDnzymROn0aE8v0p HbJAoeVmgo8qHtxAKs5wBumqbvHlDu5wPqPwuP/nSOwVGOJ1Y8QIqIi2lxe+1vRD4XO6 1oHPQcP4ZbFMnT7V+GGrSF197menM+hNo7PYngAmGXuenW74wuXZI+SOvlv85MZ8nbEZ biZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YwT0jqDh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eu9si6317094ejc.117.2021.07.15.00.50.00; Thu, 15 Jul 2021 00:50:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YwT0jqDh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238985AbhGOFIB (ORCPT + 99 others); Thu, 15 Jul 2021 01:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237347AbhGOFIB (ORCPT ); Thu, 15 Jul 2021 01:08:01 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76887C06175F; Wed, 14 Jul 2021 22:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=c36GOq3ah392G52Mqq66mFAtLZcpjZrfdzLMICjvPFs=; b=YwT0jqDhJvXc5/f3HD+OitpY4f pNf6MDEPHbmGWM9Ggc0O4Hfd+irDhP4GlVbaF7bYE3PLBaUqkaLaIHhDz6UZleZX2ycYTy1c0JTT3 mNR2bDzDqjHsDshQiYshegUdevPC9QYZu62ARm1vikdb+8k3ARD48g/Vlr9O63RT4kd3OcnwURu6P 4HpBvlp7nzz5MhbGdQ6F2aG2D13vjEECGwbZA7bgmdex91PmnQF1w9CZ93ROkADCk9wniJv17/PhC nEUUoi106lgtgEESzisJniapfRWek8pEu8dW1ksLUpyYwvj7bQqH6SShgHN9SUYP1JhMRkC3Zb/+0 XS8gh84w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tWr-002zn9-ST; Thu, 15 Jul 2021 05:03:38 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 107/138] iomap: Convert iomap_migrate_page to use folios Date: Thu, 15 Jul 2021 04:36:33 +0100 Message-Id: <20210715033704.692967-108-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The arguments are still pages for now, but we can use folios internally and cut out a lot of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 0731e2c3f44b..48de198c5603 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -490,19 +490,21 @@ int iomap_migrate_page(struct address_space *mapping, struct page *newpage, struct page *page, enum migrate_mode mode) { + struct folio *folio = page_folio(page); + struct folio *newfolio = page_folio(newpage); int ret; - ret = migrate_page_move_mapping(mapping, newpage, page, 0); + ret = folio_migrate_mapping(mapping, newfolio, folio, 0); if (ret != MIGRATEPAGE_SUCCESS) return ret; - if (page_has_private(page)) - attach_page_private(newpage, detach_page_private(page)); + if (folio_test_private(folio)) + folio_attach_private(newfolio, folio_detach_private(folio)); if (mode != MIGRATE_SYNC_NO_COPY) - migrate_page_copy(newpage, page); + folio_migrate_copy(newfolio, folio); else - migrate_page_states(newpage, page); + folio_migrate_flags(newfolio, folio); return MIGRATEPAGE_SUCCESS; } EXPORT_SYMBOL_GPL(iomap_migrate_page); -- 2.30.2