s390/mm: implement software dirty bits
[cascardo/linux.git] / include / linux / page-flags.h
index b5d1384..6d53675 100644 (file)
@@ -303,21 +303,13 @@ static inline void __SetPageUptodate(struct page *page)
 
 static inline void SetPageUptodate(struct page *page)
 {
-#ifdef CONFIG_S390
-       if (!test_and_set_bit(PG_uptodate, &page->flags))
-               page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY, 0);
-#else
        /*
         * Memory barrier must be issued before setting the PG_uptodate bit,
         * so that all previous stores issued in order to bring the page
         * uptodate are actually visible before PageUptodate becomes true.
-        *
-        * s390 doesn't need an explicit smp_wmb here because the test and
-        * set bit already provides full barriers.
         */
        smp_wmb();
        set_bit(PG_uptodate, &(page)->flags);
-#endif
 }
 
 CLEARPAGEFLAG(Uptodate, uptodate)
@@ -362,7 +354,7 @@ static inline void ClearPageCompound(struct page *page)
  * pages on the LRU and/or pagecache.
  */
 TESTPAGEFLAG(Compound, compound)
-__PAGEFLAG(Head, compound)
+__SETPAGEFLAG(Head, compound)  __CLEARPAGEFLAG(Head, compound)
 
 /*
  * PG_reclaim is used in combination with PG_compound to mark the
@@ -374,8 +366,14 @@ __PAGEFLAG(Head, compound)
  * PG_compound & PG_reclaim    => Tail page
  * PG_compound & ~PG_reclaim   => Head page
  */
+#define PG_head_mask ((1L << PG_compound))
 #define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim))
 
+static inline int PageHead(struct page *page)
+{
+       return ((page->flags & PG_head_tail_mask) == PG_head_mask);
+}
+
 static inline int PageTail(struct page *page)
 {
        return ((page->flags & PG_head_tail_mask) == PG_head_tail_mask);