aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorDaniel Kiper <dkiper@net-space.pl>2011-05-24 20:12:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 11:39:28 -0400
commitbf4e8902ee5080f5d2c810b639e7e778c8082b52 (patch)
treeab60f46992c322d1f440876ac3f444e394628173 /include/linux/mm.h
parenta3bc42f584cf9024580adeb4031d4202dac05858 (diff)
mm: enable set_page_section() only if CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP
set_page_section() is meaningful only in CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP context. Move it to proper place and amend accordingly functions which are using it. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Acked-by: Dave Hansen <dave@linux.vnet.ibm.com> Acked-by: David Rientjes <rientjes@google.com> 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.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5cbbf78eaac7..6702171f8d0a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -682,6 +682,12 @@ static inline struct zone *page_zone(struct page *page)
682} 682}
683 683
684#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) 684#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
685static inline void set_page_section(struct page *page, unsigned long section)
686{
687 page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
688 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
689}
690
685static inline unsigned long page_to_section(struct page *page) 691static inline unsigned long page_to_section(struct page *page)
686{ 692{
687 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; 693 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
@@ -700,18 +706,14 @@ static inline void set_page_node(struct page *page, unsigned long node)
700 page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; 706 page->flags |= (node & NODES_MASK) << NODES_PGSHIFT;
701} 707}
702 708
703static inline void set_page_section(struct page *page, unsigned long section)
704{
705 page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
706 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
707}
708
709static inline void set_page_links(struct page *page, enum zone_type zone, 709static inline void set_page_links(struct page *page, enum zone_type zone,
710 unsigned long node, unsigned long pfn) 710 unsigned long node, unsigned long pfn)
711{ 711{
712 set_page_zone(page, zone); 712 set_page_zone(page, zone);
713 set_page_node(page, node); 713 set_page_node(page, node);
714#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
714 set_page_section(page, pfn_to_section_nr(pfn)); 715 set_page_section(page, pfn_to_section_nr(pfn));
716#endif
715} 717}
716 718
717/* 719/*