diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index ca973359fe5f..24659ed06bae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -395,11 +395,11 @@ static inline void set_compound_order(struct page *page, unsigned long order) | |||
395 | * we have run out of space and have to fall back to an | 395 | * we have run out of space and have to fall back to an |
396 | * alternate (slower) way of determining the node. | 396 | * alternate (slower) way of determining the node. |
397 | * | 397 | * |
398 | * No sparsemem: | NODE | ZONE | ... | FLAGS | | 398 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | |
399 | * with space for node: | SECTION | NODE | ZONE | ... | FLAGS | | 399 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | |
400 | * no space for node: | SECTION | ZONE | ... | FLAGS | | 400 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | |
401 | */ | 401 | */ |
402 | #ifdef CONFIG_SPARSEMEM | 402 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) |
403 | #define SECTIONS_WIDTH SECTIONS_SHIFT | 403 | #define SECTIONS_WIDTH SECTIONS_SHIFT |
404 | #else | 404 | #else |
405 | #define SECTIONS_WIDTH 0 | 405 | #define SECTIONS_WIDTH 0 |
@@ -410,6 +410,9 @@ static inline void set_compound_order(struct page *page, unsigned long order) | |||
410 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= FLAGS_RESERVED | 410 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= FLAGS_RESERVED |
411 | #define NODES_WIDTH NODES_SHIFT | 411 | #define NODES_WIDTH NODES_SHIFT |
412 | #else | 412 | #else |
413 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
414 | #error "Vmemmap: No space for nodes field in page flags" | ||
415 | #endif | ||
413 | #define NODES_WIDTH 0 | 416 | #define NODES_WIDTH 0 |
414 | #endif | 417 | #endif |
415 | 418 | ||
@@ -502,10 +505,12 @@ static inline struct zone *page_zone(struct page *page) | |||
502 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 505 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
503 | } | 506 | } |
504 | 507 | ||
508 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
505 | static inline unsigned long page_to_section(struct page *page) | 509 | static inline unsigned long page_to_section(struct page *page) |
506 | { | 510 | { |
507 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; | 511 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; |
508 | } | 512 | } |
513 | #endif | ||
509 | 514 | ||
510 | static inline void set_page_zone(struct page *page, enum zone_type zone) | 515 | static inline void set_page_zone(struct page *page, enum zone_type zone) |
511 | { | 516 | { |