Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp589588iol; Thu, 9 Jun 2022 09:38:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV5Y0TGq2H5boKTXa0bSSg5XvwWEL9sg4YigzqAw/As2qWzeKRGtbh7jaCq+tVGef059zw X-Received: by 2002:a05:6402:1857:b0:42d:bcd6:3a88 with SMTP id v23-20020a056402185700b0042dbcd63a88mr46732429edy.6.1654792707413; Thu, 09 Jun 2022 09:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654792707; cv=none; d=google.com; s=arc-20160816; b=yaysxuiJ67bOqHo7rf/yp62EKIZPTp0mMIvjgxEMhMJawoX4rGr14dgCZMRujAKf9C 8bZI1D7B0CagnED1iOBPF4LCYPq2IUzAGb4O9/J0XjtYQJvr7/jz9sAt7ICXloTRo27X PKL40xWs1jS7d6SJDzMMGXbZlPaPZoH0GlcohVy1wJ7o12LwlsN+jQZ1AONFT90h7sCz wp+3U60+FSVEplAedW5KiUbP7A1WTK+KH0jIvDmMuUTvRH4uuaLLkmNZwJGg0Ol8SUhL 1W0cKtfxgejdfmMpSZJ3BN61a3d1h46mZWtRHIf/ap7e3jUL0z5/6OGh4fSOCvYWXzyb SbQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=zfYT+PR9lXha9hYJlMd2oONaI1SUc3WGC1Bck/G8ec0=; b=XFsk4lmMGygORSoBWTrGkqBU9swEQQgiagbksiExZa+vXjq+Xu+qAC0TdnvQDDqbok Ax0CedRQJGaAPVWCf9dWRI6BI1Ke/TVUKE+SidkPTm9SdQv5jIClN39FdNS1r8EX//uA NAhsb2GvbEEvgwaeXxwl4wEBTuSvmFxuerzEcItdtHuG+gdEC2+hWUXRLRuXu9kycwFi HE7cBZTWACEgzvzQqJjiSY/UY/xzAHJUNfJS8r0r4obYKdtZ7gmtO6UnhU8yCED3YXZW ZTYc7r51onWtn8Cv2mFLIkCCR0fiX6MflmyjmvIZtT3Lbrvn6Kxv26y0zOOzmn22BnfV Qd1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=b2KEX6ZC; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg8-20020a170907a40800b00711d56b4ec3si4662805ejc.795.2022.06.09.09.38.01; Thu, 09 Jun 2022 09:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=b2KEX6ZC; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244536AbiFIQh6 (ORCPT + 99 others); Thu, 9 Jun 2022 12:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244063AbiFIQh5 (ORCPT ); Thu, 9 Jun 2022 12:37:57 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE136994E6; Thu, 9 Jun 2022 09:37:55 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 65EBB1FECD; Thu, 9 Jun 2022 16:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1654792674; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zfYT+PR9lXha9hYJlMd2oONaI1SUc3WGC1Bck/G8ec0=; b=b2KEX6ZCINZeKoHTynlrz3FMDUbnVbIkotULQQM8wta+qakmo0wc5ILD3yfYynBGt8D1yz HYV/+JhfacH7KcZ34tTxnGAMq0+073DU9INO4NM3aBmmmH1cmHo9hWrrTnPyGWxZmapSer hIaGVqCWyAZ99ysi+fFP8RhgxxrPFtk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1654792674; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zfYT+PR9lXha9hYJlMd2oONaI1SUc3WGC1Bck/G8ec0=; b=Irv56z+I7t/5vmpdqARm0xsfrzoUND1o/lJUqjcW0uNId73f8zXP/st70yGmLiPVj3W5Qe j8Fgd9g+H7+p0iCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E9F2713A8C; Thu, 9 Jun 2022 16:37:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sFfPN+EhomK4KAAAMHmgww (envelope-from ); Thu, 09 Jun 2022 16:37:53 +0000 Date: Thu, 9 Jun 2022 18:33:23 +0200 From: David Sterba To: "Matthew Wilcox (Oracle)" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-aio@kvack.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, linux-mtd@lists.infradead.org, virtualization@lists.linux-foundation.org, Christoph Hellwig Subject: Re: [PATCH v2 12/19] btrfs: Convert btrfs_migratepage to migrate_folio Message-ID: <20220609163323.GV20633@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-aio@kvack.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, linux-mtd@lists.infradead.org, virtualization@lists.linux-foundation.org, Christoph Hellwig References: <20220608150249.3033815-1-willy@infradead.org> <20220608150249.3033815-13-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220608150249.3033815-13-willy@infradead.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-ext4@vger.kernel.org On Wed, Jun 08, 2022 at 04:02:42PM +0100, Matthew Wilcox (Oracle) wrote: > Use filemap_migrate_folio() to do the bulk of the work, and then copy > the ordered flag across if needed. > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: Christoph Hellwig Acked-by: David Sterba > +static int btrfs_migrate_folio(struct address_space *mapping, > + struct folio *dst, struct folio *src, > enum migrate_mode mode) > { > - int ret; > + int ret = filemap_migrate_folio(mapping, dst, src, mode); > > - ret = migrate_page_move_mapping(mapping, newpage, page, 0); > if (ret != MIGRATEPAGE_SUCCESS) > return ret; > > - if (page_has_private(page)) > - attach_page_private(newpage, detach_page_private(page)); If I'm reading it correctly, the private pointer does not need to be set like that anymore because it's done somewhere during the filemap_migrate_folio() call. > - > - if (PageOrdered(page)) { > - ClearPageOrdered(page); > - SetPageOrdered(newpage); > + if (folio_test_ordered(src)) { > + folio_clear_ordered(src); > + folio_set_ordered(dst); > }