]> err.no Git - linux-2.6/blobdiff - include/asm-s390/pgtable.h
Merge branch 'bsg' of git://git.kernel.dk/data/git/linux-2.6-block
[linux-2.6] / include / asm-s390 / pgtable.h
index 13c16546eff5c728d577366db2e8758201578e51..26215a976127dff569d4016f51ca4da5c7f6bb2e 100644 (file)
@@ -530,14 +530,6 @@ static inline int pte_young(pte_t pte)
        return 0;
 }
 
-static inline int pte_read(pte_t pte)
-{
-       /* All pages are readable since we don't use the fetch
-        * protection bit in the storage key.
-        */
-       return 1;
-}
-
 /*
  * pgd/pmd/pte modification functions
  */
@@ -744,7 +736,12 @@ ptep_establish(struct vm_area_struct *vma,
 }
 
 #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-       ptep_establish(__vma, __address, __ptep, __entry)
+({                                                                       \
+       int __changed = !pte_same(*(__ptep), __entry);                    \
+       if (__changed)                                                    \
+               ptep_establish(__vma, __address, __ptep, __entry);        \
+       __changed;                                                        \
+})
 
 /*
  * Test and clear dirty bit in storage key.
@@ -753,14 +750,14 @@ ptep_establish(struct vm_area_struct *vma,
  * should therefore only be called if it is not mapped in any
  * address space.
  */
-static inline int page_test_and_clear_dirty(struct page *page)
+static inline int page_test_dirty(struct page *page)
 {
-       unsigned long physpage = page_to_phys(page);
-       int skey = page_get_storage_key(physpage);
+       return (page_get_storage_key(page_to_phys(page)) & _PAGE_CHANGED) != 0;
+}
 
-       if (skey & _PAGE_CHANGED)
-               page_set_storage_key(physpage, skey & ~_PAGE_CHANGED);
-       return skey & _PAGE_CHANGED;
+static inline void page_clear_dirty(struct page *page)
+{
+       page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY);
 }
 
 /*
@@ -953,7 +950,8 @@ extern void memmap_init(unsigned long, int, unsigned long, unsigned long);
 #define __HAVE_ARCH_PTEP_CLEAR_FLUSH
 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
 #define __HAVE_ARCH_PTE_SAME
-#define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PAGE_TEST_DIRTY
+#define __HAVE_ARCH_PAGE_CLEAR_DIRTY
 #define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
 #include <asm-generic/pgtable.h>