-int folio_migrate_mapping(struct address_space *mapping, - struct folio *newfolio, struct folio *folio, int extra_count) +static void __folio_migrate_mapping(struct address_space *mapping, + struct folio *newfolio, struct folio *folio, int expected_cnt) { XA_STATE(xas, &mapping->i_pages, folio_index(folio)); struct zone *oldzone, *newzone; - int dirty; - int expected_count = folio_expected_refs(mapping, folio) + extra_count; long nr = folio_nr_pages(folio); long entries, i; + int dirty; if (!mapping) { - /* Anonymous page without mapping */
If 'mapping' was NULL, the first line would blow up while dereferencing 'mapping->i_pages'.
The ordering change was introduced by commit
89eb946a7432b "(mm: Convert page migration to XArray)"
Matthew, please correct me if I'm missing something.
thanks,
-jane