filemap: convert filemap_range_has_page() to use a folio

The folio isn't returned from this function, so this is an entirely
internal change.

Link: https://lkml.kernel.org/r/20230116193941.2148487-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Matthew Wilcox (Oracle) 2023-01-16 19:39:40 +00:00 committed by Andrew Morton
parent 8808ecab3a
commit eff3b364b4

View File

@ -470,7 +470,7 @@ EXPORT_SYMBOL(filemap_flush);
bool filemap_range_has_page(struct address_space *mapping, bool filemap_range_has_page(struct address_space *mapping,
loff_t start_byte, loff_t end_byte) loff_t start_byte, loff_t end_byte)
{ {
struct page *page; struct folio *folio;
XA_STATE(xas, &mapping->i_pages, start_byte >> PAGE_SHIFT); XA_STATE(xas, &mapping->i_pages, start_byte >> PAGE_SHIFT);
pgoff_t max = end_byte >> PAGE_SHIFT; pgoff_t max = end_byte >> PAGE_SHIFT;
@ -479,11 +479,11 @@ bool filemap_range_has_page(struct address_space *mapping,
rcu_read_lock(); rcu_read_lock();
for (;;) { for (;;) {
page = xas_find(&xas, max); folio = xas_find(&xas, max);
if (xas_retry(&xas, page)) if (xas_retry(&xas, folio))
continue; continue;
/* Shadow entries don't count */ /* Shadow entries don't count */
if (xa_is_value(page)) if (xa_is_value(folio))
continue; continue;
/* /*
* We don't need to try to pin this page; we're about to * We don't need to try to pin this page; we're about to
@ -494,7 +494,7 @@ bool filemap_range_has_page(struct address_space *mapping,
} }
rcu_read_unlock(); rcu_read_unlock();
return page != NULL; return folio != NULL;
} }
EXPORT_SYMBOL(filemap_range_has_page); EXPORT_SYMBOL(filemap_range_has_page);