diff options
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r-- | include/linux/page-flags.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 9bc5fd9fdbf6..6b202b173955 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -164,6 +164,9 @@ static inline int TestSetPage##uname(struct page *page) \ | |||
164 | static inline int TestClearPage##uname(struct page *page) \ | 164 | static inline int TestClearPage##uname(struct page *page) \ |
165 | { return test_and_clear_bit(PG_##lname, &page->flags); } | 165 | { return test_and_clear_bit(PG_##lname, &page->flags); } |
166 | 166 | ||
167 | #define __TESTCLEARFLAG(uname, lname) \ | ||
168 | static inline int __TestClearPage##uname(struct page *page) \ | ||
169 | { return __test_and_clear_bit(PG_##lname, &page->flags); } | ||
167 | 170 | ||
168 | #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ | 171 | #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ |
169 | SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) | 172 | SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) |
@@ -190,6 +193,9 @@ static inline void __ClearPage##uname(struct page *page) { } | |||
190 | #define TESTCLEARFLAG_FALSE(uname) \ | 193 | #define TESTCLEARFLAG_FALSE(uname) \ |
191 | static inline int TestClearPage##uname(struct page *page) { return 0; } | 194 | static inline int TestClearPage##uname(struct page *page) { return 0; } |
192 | 195 | ||
196 | #define __TESTCLEARFLAG_FALSE(uname) \ | ||
197 | static inline int __TestClearPage##uname(struct page *page) { return 0; } | ||
198 | |||
193 | struct page; /* forward declaration */ | 199 | struct page; /* forward declaration */ |
194 | 200 | ||
195 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) | 201 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) |
@@ -256,11 +262,11 @@ PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | |||
256 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 262 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
257 | #define MLOCK_PAGES 1 | 263 | #define MLOCK_PAGES 1 |
258 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) | 264 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) |
259 | TESTSCFLAG(Mlocked, mlocked) | 265 | TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) |
260 | #else | 266 | #else |
261 | #define MLOCK_PAGES 0 | 267 | #define MLOCK_PAGES 0 |
262 | PAGEFLAG_FALSE(Mlocked) | 268 | PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) |
263 | SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) | 269 | TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) |
264 | #endif | 270 | #endif |
265 | 271 | ||
266 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED | 272 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
@@ -411,8 +417,8 @@ static inline void __ClearPageTail(struct page *page) | |||
411 | */ | 417 | */ |
412 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) | 418 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) |
413 | 419 | ||
414 | #endif /* !__GENERATING_BOUNDS_H */ | 420 | #define PAGE_FLAGS_PRIVATE \ |
415 | 421 | (1 << PG_private | 1 << PG_private_2) | |
416 | /** | 422 | /** |
417 | * page_has_private - Determine if page has private stuff | 423 | * page_has_private - Determine if page has private stuff |
418 | * @page: The page to be checked | 424 | * @page: The page to be checked |
@@ -420,8 +426,11 @@ static inline void __ClearPageTail(struct page *page) | |||
420 | * Determine if a page has private stuff, indicating that release routines | 426 | * Determine if a page has private stuff, indicating that release routines |
421 | * should be invoked upon it. | 427 | * should be invoked upon it. |
422 | */ | 428 | */ |
423 | #define page_has_private(page) \ | 429 | static inline int page_has_private(struct page *page) |
424 | ((page)->flags & ((1 << PG_private) | \ | 430 | { |
425 | (1 << PG_private_2))) | 431 | return !!(page->flags & PAGE_FLAGS_PRIVATE); |
432 | } | ||
433 | |||
434 | #endif /* !__GENERATING_BOUNDS_H */ | ||
426 | 435 | ||
427 | #endif /* PAGE_FLAGS_H */ | 436 | #endif /* PAGE_FLAGS_H */ |