diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-09-26 02:31:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:46 -0400 |
commit | 2f1b6248682f8b39ca3c7e549dfc216d26c4109b (patch) | |
tree | 2340347d10fd0e564fb8527efe3ffbcb216e1906 /include/linux/mm.h | |
parent | 98d2b0ebda72fc39cdefd3720d50b9b3ce409085 (diff) |
[PATCH] reduce MAX_NR_ZONES: use enum to define zones, reformat and comment
Use enum for zones and reformat zones dependent information
Add comments explaning the use of zones and add a zones_t type for zone
numbers.
Line up information that will be #ifdefd by the following patches.
[akpm@osdl.org: comment cleanups]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 45678b036955..2db4229a0066 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -470,7 +470,7 @@ void split_page(struct page *page, unsigned int order); | |||
470 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 470 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
471 | #define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1) | 471 | #define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1) |
472 | 472 | ||
473 | static inline unsigned long page_zonenum(struct page *page) | 473 | static inline enum zone_type page_zonenum(struct page *page) |
474 | { | 474 | { |
475 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 475 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
476 | } | 476 | } |
@@ -499,11 +499,12 @@ static inline unsigned long page_to_section(struct page *page) | |||
499 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; | 499 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; |
500 | } | 500 | } |
501 | 501 | ||
502 | static inline void set_page_zone(struct page *page, unsigned long zone) | 502 | static inline void set_page_zone(struct page *page, enum zone_type zone) |
503 | { | 503 | { |
504 | page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT); | 504 | page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT); |
505 | page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT; | 505 | page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT; |
506 | } | 506 | } |
507 | |||
507 | static inline void set_page_node(struct page *page, unsigned long node) | 508 | static inline void set_page_node(struct page *page, unsigned long node) |
508 | { | 509 | { |
509 | page->flags &= ~(NODES_MASK << NODES_PGSHIFT); | 510 | page->flags &= ~(NODES_MASK << NODES_PGSHIFT); |
@@ -515,7 +516,7 @@ static inline void set_page_section(struct page *page, unsigned long section) | |||
515 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | 516 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; |
516 | } | 517 | } |
517 | 518 | ||
518 | static inline void set_page_links(struct page *page, unsigned long zone, | 519 | static inline void set_page_links(struct page *page, enum zone_type zone, |
519 | unsigned long node, unsigned long pfn) | 520 | unsigned long node, unsigned long pfn) |
520 | { | 521 | { |
521 | set_page_zone(page, zone); | 522 | set_page_zone(page, zone); |