diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-08 01:31:11 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-08 01:31:11 -0400 |
commit | 334d0dd8b660557608142f0f77abc6812b48f08b (patch) | |
tree | 9393a9aa099d7d42deda5f9f5054796c0c769be7 /include/linux/page-flags.h | |
parent | 3f07d8796262f6aee135c8dd9a91210da9f888e4 (diff) | |
parent | 5b94f675f57e4ff16c8fda09088d7480a84dcd91 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r-- | include/linux/page-flags.h | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 96326594e55d..ae2d79f2107e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #define PAGE_FLAGS_H | 6 | #define PAGE_FLAGS_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/mm_types.h> | ||
9 | 10 | ||
10 | /* | 11 | /* |
11 | * Various page->flags bits: | 12 | * Various page->flags bits: |
@@ -82,13 +83,11 @@ | |||
82 | #define PG_private 11 /* If pagecache, has fs-private data */ | 83 | #define PG_private 11 /* If pagecache, has fs-private data */ |
83 | 84 | ||
84 | #define PG_writeback 12 /* Page is under writeback */ | 85 | #define PG_writeback 12 /* Page is under writeback */ |
85 | #define PG_nosave 13 /* Used for system suspend/resume */ | ||
86 | #define PG_compound 14 /* Part of a compound page */ | 86 | #define PG_compound 14 /* Part of a compound page */ |
87 | #define PG_swapcache 15 /* Swap page: swp_entry_t in private */ | 87 | #define PG_swapcache 15 /* Swap page: swp_entry_t in private */ |
88 | 88 | ||
89 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ | 89 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
90 | #define PG_reclaim 17 /* To be reclaimed asap */ | 90 | #define PG_reclaim 17 /* To be reclaimed asap */ |
91 | #define PG_nosave_free 18 /* Used for system suspend/resume */ | ||
92 | #define PG_buddy 19 /* Page is free, on buddy lists */ | 91 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
93 | 92 | ||
94 | /* PG_owner_priv_1 users should have descriptive aliases */ | 93 | /* PG_owner_priv_1 users should have descriptive aliases */ |
@@ -214,16 +213,6 @@ static inline void SetPageUptodate(struct page *page) | |||
214 | ret; \ | 213 | ret; \ |
215 | }) | 214 | }) |
216 | 215 | ||
217 | #define PageNosave(page) test_bit(PG_nosave, &(page)->flags) | ||
218 | #define SetPageNosave(page) set_bit(PG_nosave, &(page)->flags) | ||
219 | #define TestSetPageNosave(page) test_and_set_bit(PG_nosave, &(page)->flags) | ||
220 | #define ClearPageNosave(page) clear_bit(PG_nosave, &(page)->flags) | ||
221 | #define TestClearPageNosave(page) test_and_clear_bit(PG_nosave, &(page)->flags) | ||
222 | |||
223 | #define PageNosaveFree(page) test_bit(PG_nosave_free, &(page)->flags) | ||
224 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) | ||
225 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) | ||
226 | |||
227 | #define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) | 216 | #define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) |
228 | #define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) | 217 | #define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) |
229 | #define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) | 218 | #define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) |
@@ -241,6 +230,34 @@ static inline void SetPageUptodate(struct page *page) | |||
241 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) | 230 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) |
242 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) | 231 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) |
243 | 232 | ||
233 | /* | ||
234 | * PG_reclaim is used in combination with PG_compound to mark the | ||
235 | * head and tail of a compound page | ||
236 | * | ||
237 | * PG_compound & PG_reclaim => Tail page | ||
238 | * PG_compound & ~PG_reclaim => Head page | ||
239 | */ | ||
240 | |||
241 | #define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim)) | ||
242 | |||
243 | #define PageTail(page) ((page->flags & PG_head_tail_mask) \ | ||
244 | == PG_head_tail_mask) | ||
245 | |||
246 | static inline void __SetPageTail(struct page *page) | ||
247 | { | ||
248 | page->flags |= PG_head_tail_mask; | ||
249 | } | ||
250 | |||
251 | static inline void __ClearPageTail(struct page *page) | ||
252 | { | ||
253 | page->flags &= ~PG_head_tail_mask; | ||
254 | } | ||
255 | |||
256 | #define PageHead(page) ((page->flags & PG_head_tail_mask) \ | ||
257 | == (1L << PG_compound)) | ||
258 | #define __SetPageHead(page) __SetPageCompound(page) | ||
259 | #define __ClearPageHead(page) __ClearPageCompound(page) | ||
260 | |||
244 | #ifdef CONFIG_SWAP | 261 | #ifdef CONFIG_SWAP |
245 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) | 262 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) |
246 | #define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags) | 263 | #define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags) |