diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-28 05:12:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:22 -0400 |
commit | ec7cade8c1a3d1ace69b35cc843b181818578dce (patch) | |
tree | 32ab77ff6b58cb55834e729fa020eb91ef9940f0 /include | |
parent | 602c4d112f9abf43af4b882b4a6f5505ed5c51b7 (diff) |
page flags: add PAGEFLAGS_FALSE for flags that are always false
Turns out that there are a number of times that a flag is simply always
returning 0. Define a macro for that.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/page-flags.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 17deafa9eb9b..d16efa9066d9 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -134,6 +134,10 @@ static inline int TestClearPage##uname(struct page *page) \ | |||
134 | #define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ | 134 | #define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ |
135 | __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) | 135 | __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) |
136 | 136 | ||
137 | #define PAGEFLAG_FALSE(uname) \ | ||
138 | static inline int Page##uname(struct page *page) \ | ||
139 | { return 0; } | ||
140 | |||
137 | #define TESTSCFLAG(uname, lname) \ | 141 | #define TESTSCFLAG(uname, lname) \ |
138 | TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) | 142 | TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) |
139 | 143 | ||
@@ -171,28 +175,19 @@ PAGEFLAG(Readahead, reclaim) /* Reminder to do async read-ahead */ | |||
171 | */ | 175 | */ |
172 | #define PageHighMem(__p) is_highmem(page_zone(__p)) | 176 | #define PageHighMem(__p) is_highmem(page_zone(__p)) |
173 | #else | 177 | #else |
174 | static inline int PageHighMem(struct page *page) | 178 | PAGEFLAG_FALSE(HighMem) |
175 | { | ||
176 | return 0; | ||
177 | } | ||
178 | #endif | 179 | #endif |
179 | 180 | ||
180 | #ifdef CONFIG_SWAP | 181 | #ifdef CONFIG_SWAP |
181 | PAGEFLAG(SwapCache, swapcache) | 182 | PAGEFLAG(SwapCache, swapcache) |
182 | #else | 183 | #else |
183 | static inline int PageSwapCache(struct page *page) | 184 | PAGEFLAG_FALSE(SwapCache) |
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | #endif | 185 | #endif |
188 | 186 | ||
189 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 187 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR |
190 | PAGEFLAG(Uncached, uncached) | 188 | PAGEFLAG(Uncached, uncached) |
191 | #else | 189 | #else |
192 | static inline int PageUncached(struct page *) | 190 | PAGEFLAG_FALSE(Uncached) |
193 | { | ||
194 | return 0; | ||
195 | } | ||
196 | #endif | 191 | #endif |
197 | 192 | ||
198 | static inline int PageUptodate(struct page *page) | 193 | static inline int PageUptodate(struct page *page) |