The patch titled Subject: filemap: convert filemap_range_has_writeback() to use folios has been added to the -mm mm-unstable branch. Its filename is filemap-convert-filemap_range_has_writeback-to-use-folios.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/filemap-convert-filemap_range_has_writeback-to-use-folios.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Vishal Moola (Oracle)" <vishal.moola@xxxxxxxxx> Subject: filemap: convert filemap_range_has_writeback() to use folios Date: Mon, 5 Sep 2022 14:45:57 -0700 Removes 3 calls to compound_head(). Link: https://lkml.kernel.org/r/20220905214557.868606-1-vishal.moola@xxxxxxxxx Signed-off-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/filemap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/mm/filemap.c~filemap-convert-filemap_range_has_writeback-to-use-folios +++ a/mm/filemap.c @@ -632,22 +632,23 @@ bool filemap_range_has_writeback(struct { XA_STATE(xas, &mapping->i_pages, start_byte >> PAGE_SHIFT); pgoff_t max = end_byte >> PAGE_SHIFT; - struct page *page; + struct folio *folio; if (end_byte < start_byte) return false; rcu_read_lock(); - xas_for_each(&xas, page, max) { - if (xas_retry(&xas, page)) + xas_for_each(&xas, folio, max) { + if (xas_retry(&xas, folio)) continue; - if (xa_is_value(page)) + if (xa_is_value(folio)) continue; - if (PageDirty(page) || PageLocked(page) || PageWriteback(page)) + if (folio_test_dirty(folio) || folio_test_locked(folio) || + folio_test_writeback(folio)) break; } rcu_read_unlock(); - return page != NULL; + return folio != NULL; } EXPORT_SYMBOL_GPL(filemap_range_has_writeback); _ Patches currently in -mm which might be from vishal.moola@xxxxxxxxx are filemap-add-filemap_get_folios_contig.patch btrfs-convert-__process_pages_contig-to-use-filemap_get_folios_contig.patch btrfs-convert-end_compressed_writeback-to-use-filemap_get_folios.patch btrfs-convert-process_page_range-to-use-filemap_get_folios_contig.patch nilfs2-convert-nilfs_find_uncommited_extent-to-use-filemap_get_folios_contig.patch ramfs-convert-ramfs_nommu_get_unmapped_area-to-use-filemap_get_folios_contig.patch filemap-remove-find_get_pages_contig.patch filemap-convert-filemap_range_has_writeback-to-use-folios.patch