diff options
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r-- | include/linux/page-flags.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 9ea629c02a4b..d276a4e2f825 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -48,8 +48,20 @@ | |||
48 | 48 | ||
49 | /* | 49 | /* |
50 | * Don't use the *_dontuse flags. Use the macros. Otherwise you'll break | 50 | * Don't use the *_dontuse flags. Use the macros. Otherwise you'll break |
51 | * locked- and dirty-page accounting. The top eight bits of page->flags are | 51 | * locked- and dirty-page accounting. |
52 | * used for page->zone, so putting flag bits there doesn't work. | 52 | * |
53 | * The page flags field is split into two parts, the main flags area | ||
54 | * which extends from the low bits upwards, and the fields area which | ||
55 | * extends from the high bits downwards. | ||
56 | * | ||
57 | * | FIELD | ... | FLAGS | | ||
58 | * N-1 ^ 0 | ||
59 | * (N-FLAGS_RESERVED) | ||
60 | * | ||
61 | * The fields area is reserved for fields mapping zone, node and SPARSEMEM | ||
62 | * section. The boundry between these two areas is defined by | ||
63 | * FLAGS_RESERVED which defines the width of the fields section | ||
64 | * (see linux/mmzone.h). New flags must _not_ overlap with this area. | ||
53 | */ | 65 | */ |
54 | #define PG_locked 0 /* Page is locked. Don't touch. */ | 66 | #define PG_locked 0 /* Page is locked. Don't touch. */ |
55 | #define PG_error 1 | 67 | #define PG_error 1 |
@@ -74,7 +86,9 @@ | |||
74 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ | 86 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
75 | #define PG_reclaim 17 /* To be reclaimed asap */ | 87 | #define PG_reclaim 17 /* To be reclaimed asap */ |
76 | #define PG_nosave_free 18 /* Free, should not be written */ | 88 | #define PG_nosave_free 18 /* Free, should not be written */ |
77 | #define PG_uncached 19 /* Page has been mapped as uncached */ | 89 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
90 | |||
91 | #define PG_uncached 20 /* Page has been mapped as uncached */ | ||
78 | 92 | ||
79 | /* | 93 | /* |
80 | * Global page accounting. One instance per CPU. Only unsigned longs are | 94 | * Global page accounting. One instance per CPU. Only unsigned longs are |
@@ -317,6 +331,10 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
317 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) | 331 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) |
318 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) | 332 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) |
319 | 333 | ||
334 | #define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) | ||
335 | #define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) | ||
336 | #define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) | ||
337 | |||
320 | #define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags) | 338 | #define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags) |
321 | #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) | 339 | #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) |
322 | #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) | 340 | #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) |