]> err.no Git - linux-2.6/blobdiff - include/asm-s390/pgtable.h
dma-mapping: prevent dma dependent code from linking on !HAS_DMA archs
[linux-2.6] / include / asm-s390 / pgtable.h
index 8fe8d42e64c3dcafa0fc486cc8ce46ef723b5593..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.