diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-28 05:12:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:21 -0400 |
commit | 9223b4190fa1297a59f292f3419fc0285321d0ea (patch) | |
tree | c6fbbc6b4c35916232e95686194eea1bd9de7377 /include/linux/page-flags.h | |
parent | e26831814998cee8e6d9f0a9854cb46c516f5547 (diff) |
pageflags: get rid of FLAGS_RESERVED
NR_PAGEFLAGS specifies the number of page flags we are using. From that we
can calculate the number of bits leftover that can be used for zone, node (and
maybe the sections id). There is no need anymore for FLAGS_RESERVED if we use
NR_PAGEFLAGS.
Use the new methods to make NR_PAGEFLAGS available via the preprocessor.
NR_PAGEFLAGS is used to calculate field boundaries in the page flags fields.
These field widths have to be available to the preprocessor.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: David Miller <davem@davemloft.net>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r-- | include/linux/page-flags.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d66971530caa..00e55e23b777 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -6,7 +6,10 @@ | |||
6 | #define PAGE_FLAGS_H | 6 | #define PAGE_FLAGS_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #ifndef __GENERATING_BOUNDS_H | ||
9 | #include <linux/mm_types.h> | 10 | #include <linux/mm_types.h> |
11 | #include <linux/bounds.h> | ||
12 | #endif /* !__GENERATING_BOUNDS_H */ | ||
10 | 13 | ||
11 | /* | 14 | /* |
12 | * Various page->flags bits: | 15 | * Various page->flags bits: |
@@ -59,13 +62,12 @@ | |||
59 | * extends from the high bits downwards. | 62 | * extends from the high bits downwards. |
60 | * | 63 | * |
61 | * | FIELD | ... | FLAGS | | 64 | * | FIELD | ... | FLAGS | |
62 | * N-1 ^ 0 | 65 | * N-1 ^ 0 |
63 | * (N-FLAGS_RESERVED) | 66 | * (NR_PAGEFLAGS) |
64 | * | 67 | * |
65 | * The fields area is reserved for fields mapping zone, node and SPARSEMEM | 68 | * The fields area is reserved for fields mapping zone, node (for NUMA) and |
66 | * section. The boundry between these two areas is defined by | 69 | * SPARSEMEM section (for variants of SPARSEMEM that require section ids like |
67 | * FLAGS_RESERVED which defines the width of the fields section | 70 | * SPARSEMEM_EXTREME with !SPARSEMEM_VMEMMAP). |
68 | * (see linux/mmzone.h). New flags must _not_ overlap with this area. | ||
69 | */ | 71 | */ |
70 | enum pageflags { | 72 | enum pageflags { |
71 | PG_locked, /* Page is locked. Don't touch. */ | 73 | PG_locked, /* Page is locked. Don't touch. */ |
@@ -101,9 +103,11 @@ enum pageflags { | |||
101 | */ | 103 | */ |
102 | PG_uncached = 31, /* Page has been mapped as uncached */ | 104 | PG_uncached = 31, /* Page has been mapped as uncached */ |
103 | #endif | 105 | #endif |
104 | NR_PAGEFLAGS | 106 | __NR_PAGEFLAGS |
105 | }; | 107 | }; |
106 | 108 | ||
109 | #ifndef __GENERATING_BOUNDS_H | ||
110 | |||
107 | /* | 111 | /* |
108 | * Manipulation of page state flags | 112 | * Manipulation of page state flags |
109 | */ | 113 | */ |
@@ -304,4 +308,5 @@ static inline void set_page_writeback(struct page *page) | |||
304 | test_set_page_writeback(page); | 308 | test_set_page_writeback(page); |
305 | } | 309 | } |
306 | 310 | ||
311 | #endif /* !__GENERATING_BOUNDS_H */ | ||
307 | #endif /* PAGE_FLAGS_H */ | 312 | #endif /* PAGE_FLAGS_H */ |