diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2015-07-09 07:49:30 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-10-17 08:18:19 -0400 |
commit | 52585bcc2505d6f888d4ac68ca6c55f6d1ad736a (patch) | |
tree | 0a6d14c792e9a221b796a7979afdc7642dd0d27f | |
parent | 443a6312832fe7362edffed960204f750b230f46 (diff) |
mm: group pte related helpers together
This reduces/simplifies the diff for the next patch which moves THP
specific code.
No semantical changes !
Acked-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com
Link: http://lkml.kernel.org/r/1442918096-17454-9-git-send-email-vgupta@synopsys.com
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | mm/pgtable-generic.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 6b674e00153c..48851894e699 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c | |||
@@ -57,6 +57,31 @@ int ptep_set_access_flags(struct vm_area_struct *vma, | |||
57 | } | 57 | } |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | ||
61 | int ptep_clear_flush_young(struct vm_area_struct *vma, | ||
62 | unsigned long address, pte_t *ptep) | ||
63 | { | ||
64 | int young; | ||
65 | young = ptep_test_and_clear_young(vma, address, ptep); | ||
66 | if (young) | ||
67 | flush_tlb_page(vma, address); | ||
68 | return young; | ||
69 | } | ||
70 | #endif | ||
71 | |||
72 | #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH | ||
73 | pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, | ||
74 | pte_t *ptep) | ||
75 | { | ||
76 | struct mm_struct *mm = (vma)->vm_mm; | ||
77 | pte_t pte; | ||
78 | pte = ptep_get_and_clear(mm, address, ptep); | ||
79 | if (pte_accessible(mm, pte)) | ||
80 | flush_tlb_page(vma, address); | ||
81 | return pte; | ||
82 | } | ||
83 | #endif | ||
84 | |||
60 | #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS | 85 | #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS |
61 | int pmdp_set_access_flags(struct vm_area_struct *vma, | 86 | int pmdp_set_access_flags(struct vm_area_struct *vma, |
62 | unsigned long address, pmd_t *pmdp, | 87 | unsigned long address, pmd_t *pmdp, |
@@ -77,18 +102,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, | |||
77 | } | 102 | } |
78 | #endif | 103 | #endif |
79 | 104 | ||
80 | #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | ||
81 | int ptep_clear_flush_young(struct vm_area_struct *vma, | ||
82 | unsigned long address, pte_t *ptep) | ||
83 | { | ||
84 | int young; | ||
85 | young = ptep_test_and_clear_young(vma, address, ptep); | ||
86 | if (young) | ||
87 | flush_tlb_page(vma, address); | ||
88 | return young; | ||
89 | } | ||
90 | #endif | ||
91 | |||
92 | #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH | 105 | #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH |
93 | int pmdp_clear_flush_young(struct vm_area_struct *vma, | 106 | int pmdp_clear_flush_young(struct vm_area_struct *vma, |
94 | unsigned long address, pmd_t *pmdp) | 107 | unsigned long address, pmd_t *pmdp) |
@@ -106,19 +119,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, | |||
106 | } | 119 | } |
107 | #endif | 120 | #endif |
108 | 121 | ||
109 | #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH | ||
110 | pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, | ||
111 | pte_t *ptep) | ||
112 | { | ||
113 | struct mm_struct *mm = (vma)->vm_mm; | ||
114 | pte_t pte; | ||
115 | pte = ptep_get_and_clear(mm, address, ptep); | ||
116 | if (pte_accessible(mm, pte)) | ||
117 | flush_tlb_page(vma, address); | ||
118 | return pte; | ||
119 | } | ||
120 | #endif | ||
121 | |||
122 | #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH | 122 | #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH |
123 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 123 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
124 | pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, | 124 | pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, |