diff options
author | Cody P Schafer <cody@linux.vnet.ibm.com> | 2013-02-22 19:35:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 20:50:20 -0500 |
commit | 9127ab4ff92f0ecd7b4671efa9d0edb21c691e9f (patch) | |
tree | dbf80a98e775d88378d93c0d20209374d6fac9b2 /include/linux/mm.h | |
parent | 4805b02e90187c68d8f4e3305c3482b797e35809 (diff) |
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 <cody@linux.vnet.ibm.com>
Cc: David Hansen <dave@linux.vnet.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index fe039bdba4ed..97da0302cf51 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -625,6 +625,10 @@ static inline enum zone_type page_zonenum(const struct page *page) | |||
625 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 625 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
626 | } | 626 | } |
627 | 627 | ||
628 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
629 | #define SECTION_IN_PAGE_FLAGS | ||
630 | #endif | ||
631 | |||
628 | /* | 632 | /* |
629 | * The identification function is only used by the buddy allocator for | 633 | * The identification function is only used by the buddy allocator for |
630 | * determining if two pages could be buddies. We are not really | 634 | * 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) | |||
708 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 712 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
709 | } | 713 | } |
710 | 714 | ||
711 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 715 | #ifdef SECTION_IN_PAGE_FLAGS |
712 | static inline void set_page_section(struct page *page, unsigned long section) | 716 | static inline void set_page_section(struct page *page, unsigned long section) |
713 | { | 717 | { |
714 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | 718 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); |
@@ -738,7 +742,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
738 | { | 742 | { |
739 | set_page_zone(page, zone); | 743 | set_page_zone(page, zone); |
740 | set_page_node(page, node); | 744 | set_page_node(page, node); |
741 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 745 | #ifdef SECTION_IN_PAGE_FLAGS |
742 | set_page_section(page, pfn_to_section_nr(pfn)); | 746 | set_page_section(page, pfn_to_section_nr(pfn)); |
743 | #endif | 747 | #endif |
744 | } | 748 | } |