aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/page-flags.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r--include/linux/page-flags.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 5a743cc87238..4835cae71047 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -347,7 +347,7 @@ static inline void set_page_writeback(struct page *page)
347 * tests can be used in performance sensitive paths. PageCompound is 347 * tests can be used in performance sensitive paths. PageCompound is
348 * generally not used in hot code paths. 348 * generally not used in hot code paths.
349 */ 349 */
350__PAGEFLAG(Head, head) 350__PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head)
351__PAGEFLAG(Tail, tail) 351__PAGEFLAG(Tail, tail)
352 352
353static inline int PageCompound(struct page *page) 353static inline int PageCompound(struct page *page)
@@ -355,6 +355,13 @@ static inline int PageCompound(struct page *page)
355 return page->flags & ((1L << PG_head) | (1L << PG_tail)); 355 return page->flags & ((1L << PG_head) | (1L << PG_tail));
356 356
357} 357}
358#ifdef CONFIG_TRANSPARENT_HUGEPAGE
359static inline void ClearPageCompound(struct page *page)
360{
361 BUG_ON(!PageHead(page));
362 ClearPageHead(page);
363}
364#endif
358#else 365#else
359/* 366/*
360 * Reduce page flag use as much as possible by overlapping 367 * Reduce page flag use as much as possible by overlapping
@@ -392,6 +399,14 @@ static inline void __ClearPageTail(struct page *page)
392 page->flags &= ~PG_head_tail_mask; 399 page->flags &= ~PG_head_tail_mask;
393} 400}
394 401
402#ifdef CONFIG_TRANSPARENT_HUGEPAGE
403static inline void ClearPageCompound(struct page *page)
404{
405 BUG_ON((page->flags & PG_head_tail_mask) != (1 << PG_compound));
406 clear_bit(PG_compound, &page->flags);
407}
408#endif
409
395#endif /* !PAGEFLAGS_EXTENDED */ 410#endif /* !PAGEFLAGS_EXTENDED */
396 411
397#ifdef CONFIG_MMU 412#ifdef CONFIG_MMU