diff options
Diffstat (limited to 'include/linux/pageblock-flags.h')
-rw-r--r-- | include/linux/pageblock-flags.h | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index 2ee8cd2466b5..c08730c10c7a 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h | |||
@@ -30,9 +30,12 @@ enum pageblock_bits { | |||
30 | PB_migrate, | 30 | PB_migrate, |
31 | PB_migrate_end = PB_migrate + 3 - 1, | 31 | PB_migrate_end = PB_migrate + 3 - 1, |
32 | /* 3 bits required for migrate types */ | 32 | /* 3 bits required for migrate types */ |
33 | #ifdef CONFIG_COMPACTION | ||
34 | PB_migrate_skip,/* If set the block is skipped by compaction */ | 33 | PB_migrate_skip,/* If set the block is skipped by compaction */ |
35 | #endif /* CONFIG_COMPACTION */ | 34 | |
35 | /* | ||
36 | * Assume the bits will always align on a word. If this assumption | ||
37 | * changes then get/set pageblock needs updating. | ||
38 | */ | ||
36 | NR_PAGEBLOCK_BITS | 39 | NR_PAGEBLOCK_BITS |
37 | }; | 40 | }; |
38 | 41 | ||
@@ -62,11 +65,33 @@ extern int pageblock_order; | |||
62 | /* Forward declaration */ | 65 | /* Forward declaration */ |
63 | struct page; | 66 | struct page; |
64 | 67 | ||
68 | unsigned long get_pageblock_flags_mask(struct page *page, | ||
69 | unsigned long end_bitidx, | ||
70 | unsigned long mask); | ||
71 | void set_pageblock_flags_mask(struct page *page, | ||
72 | unsigned long flags, | ||
73 | unsigned long end_bitidx, | ||
74 | unsigned long mask); | ||
75 | |||
65 | /* Declarations for getting and setting flags. See mm/page_alloc.c */ | 76 | /* Declarations for getting and setting flags. See mm/page_alloc.c */ |
66 | unsigned long get_pageblock_flags_group(struct page *page, | 77 | static inline unsigned long get_pageblock_flags_group(struct page *page, |
67 | int start_bitidx, int end_bitidx); | 78 | int start_bitidx, int end_bitidx) |
68 | void set_pageblock_flags_group(struct page *page, unsigned long flags, | 79 | { |
69 | int start_bitidx, int end_bitidx); | 80 | unsigned long nr_flag_bits = end_bitidx - start_bitidx + 1; |
81 | unsigned long mask = (1 << nr_flag_bits) - 1; | ||
82 | |||
83 | return get_pageblock_flags_mask(page, end_bitidx, mask); | ||
84 | } | ||
85 | |||
86 | static inline void set_pageblock_flags_group(struct page *page, | ||
87 | unsigned long flags, | ||
88 | int start_bitidx, int end_bitidx) | ||
89 | { | ||
90 | unsigned long nr_flag_bits = end_bitidx - start_bitidx + 1; | ||
91 | unsigned long mask = (1 << nr_flag_bits) - 1; | ||
92 | |||
93 | set_pageblock_flags_mask(page, flags, end_bitidx, mask); | ||
94 | } | ||
70 | 95 | ||
71 | #ifdef CONFIG_COMPACTION | 96 | #ifdef CONFIG_COMPACTION |
72 | #define get_pageblock_skip(page) \ | 97 | #define get_pageblock_skip(page) \ |