static int get_nid_for_pfn(unsigned long pfn) { struct page *page; if (!pfn_valid_within(pfn)) return -1; page = pfn_to_page(pfn); if (!page_initialized(page)) return -1; return pfn_to_nid(pfn); }
static int __ref get_nid_for_pfn(unsigned long pfn) { struct page *page; if (!pfn_valid_within(pfn)) return -1; #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT if (system_state == SYSTEM_BOOTING) return early_pfn_to_nid(pfn); #endif page = pfn_to_page(pfn); if (!page_initialized(page)) return -1; return pfn_to_nid(pfn); }