Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3460094pxb; Mon, 1 Nov 2021 14:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoEwTkOPrjhRqf/XKgoMDdTol4pa7YmNyfW2Ga6bGjihtIP2usJ9zbqe7IfzDiGG0HxjfK X-Received: by 2002:a05:6e02:1403:: with SMTP id n3mr21974247ilo.245.1635801397489; Mon, 01 Nov 2021 14:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635801397; cv=none; d=google.com; s=arc-20160816; b=DHbcnASQMpklZpcYtPseqc8bVXjjOJiIZRI/75S2gAGR5GjDBXY66AnCLp/OjBYu8P u/NfxOPHp9bnEAywvd5NFfN3pWQ0OW5pNbprA4UwkbyX9c7O6aXBTrhxfrZ72MOdEL4P KSr7kuQliMcVp7EoQxemELh9vQN+8xrmVEyYluzTB8mRZ6yTbiYaeQrxmpOXl9/pMxXX XCybE+cyD92mv4U5KnWDZ+6+iOhbAGoEROjWSwvwb6A0s1JlB8suZFcuNG33EOQxh/9A GAv0stusotThYxeLyld/Gr9aZ4Fx4qE0TmAp9JOsLR7A2inffGtNoHqTGF8A6k3XFHL4 /rSQ== 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=XzK2PYsyWCkmNM3XtXYY+PTMPCbY/9k/CJ1ax9f53AI=; b=wvqA9iOUjuIPGU20KmNUIAJZIgXPCWfEGGkJNI6rbKGJl+AsBS0pBzFJERsMBrj9Jt dBQrLXVTsRbovAMi1Y6EylpC8q7aZJrDtVP1MT4PUW8lLk6kF6sCe+U1q9vS35dfZPpb OXzHoFs24h1mHLViyK/l0hCWv24O7yAp/cMmW2wmLNE1a8yE8m+fUgtlx8fBhr7pqWnM AwGoQ2LgrMu3ktdCr2xKjhhiIEMfaXswIeogZxZaKjS8A7NNTRjTi6Cnq9JlBRCMr/07 OdsZJrfUiIZIsFwKOpjxVySyZIQMCxJv9ubUfTjoPm6p+M2wC0TJb4XXniJIHin3IJn1 eikQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CcdjXVH+; 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 h5si8437135ilq.93.2021.11.01.14.16.19; Mon, 01 Nov 2021 14:16:37 -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=CcdjXVH+; 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 S230246AbhKAVSC (ORCPT + 99 others); Mon, 1 Nov 2021 17:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbhKAVR7 (ORCPT ); Mon, 1 Nov 2021 17:17:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BBE2C061714; Mon, 1 Nov 2021 14:15:19 -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=XzK2PYsyWCkmNM3XtXYY+PTMPCbY/9k/CJ1ax9f53AI=; b=CcdjXVH+SoeDoVpuZyw1HqxrfM Udx0FtOZui3Klno3q3ftFogTama4MPLQK7Lzb6wqUJm4SaOKX9+iwosJsceDRzZyHONdrIcMVobwc SozJdxsOU/eriWSJ5By2UK5R5U34TdGj4N2uOwTETj3wGz/scMVj59BxVRqH5k0gjXETjnpbHMIRE 3xawIRc4nl2GK5S4utVVM774X5y7SAcLaXXRA7tGaIzcbeCEbTjEJttw2vOib2Br5+4jNjsoY3aQl MP9z9KtU+wegOckWNCJOgetOoxNzGcfaTcrtss9zwx6SbZRPKVXR6/loQBAXo1/eUYtmvYZquPdIg KKKel/9Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mheZp-0041yw-Ei; Mon, 01 Nov 2021 21:11:26 +0000 From: "Matthew Wilcox (Oracle)" To: "Darrick J. Wong" Cc: "Matthew Wilcox (Oracle)" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig Subject: [PATCH 19/21] iomap: Convert iomap_migrate_page to use folios Date: Mon, 1 Nov 2021 20:39:27 +0000 Message-Id: <20211101203929.954622-20-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101203929.954622-1-willy@infradead.org> References: <20211101203929.954622-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 2436933dfe42..3b93fdfedb72 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -493,19 +493,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.33.0