Skip to content

Commit 9127ab4

Browse files
codypstorvalds
authored andcommitted
mm: add SECTION_IN_PAGE_FLAGS
Instead of directly utilizing a combination of config options to determine this, add a macro to specifically address it. Signed-off-by: Cody P Schafer <[email protected]> Cc: David Hansen <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4805b02 commit 9127ab4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/linux/mm.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,10 @@ static inline enum zone_type page_zonenum(const struct page *page)
625625
return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
626626
}
627627

628+
#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
629+
#define SECTION_IN_PAGE_FLAGS
630+
#endif
631+
628632
/*
629633
* The identification function is only used by the buddy allocator for
630634
* determining if two pages could be buddies. We are not really
@@ -708,7 +712,7 @@ static inline struct zone *page_zone(const struct page *page)
708712
return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
709713
}
710714

711-
#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
715+
#ifdef SECTION_IN_PAGE_FLAGS
712716
static inline void set_page_section(struct page *page, unsigned long section)
713717
{
714718
page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
@@ -738,7 +742,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
738742
{
739743
set_page_zone(page, zone);
740744
set_page_node(page, node);
741-
#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
745+
#ifdef SECTION_IN_PAGE_FLAGS
742746
set_page_section(page, pfn_to_section_nr(pfn));
743747
#endif
744748
}

0 commit comments

Comments
 (0)