aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmu_notifier.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mmu_notifier.c')
-rw-r--r--mm/mmu_notifier.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 2175fb0d501c..be04122fb277 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -95,11 +95,10 @@ int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
95 unsigned long address) 95 unsigned long address)
96{ 96{
97 struct mmu_notifier *mn; 97 struct mmu_notifier *mn;
98 struct hlist_node *n;
99 int young = 0, id; 98 int young = 0, id;
100 99
101 id = srcu_read_lock(&srcu); 100 id = srcu_read_lock(&srcu);
102 hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) { 101 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
103 if (mn->ops->clear_flush_young) 102 if (mn->ops->clear_flush_young)
104 young |= mn->ops->clear_flush_young(mn, mm, address); 103 young |= mn->ops->clear_flush_young(mn, mm, address);
105 } 104 }
@@ -112,11 +111,10 @@ int __mmu_notifier_test_young(struct mm_struct *mm,
112 unsigned long address) 111 unsigned long address)
113{ 112{
114 struct mmu_notifier *mn; 113 struct mmu_notifier *mn;
115 struct hlist_node *n;
116 int young = 0, id; 114 int young = 0, id;
117 115
118 id = srcu_read_lock(&srcu); 116 id = srcu_read_lock(&srcu);
119 hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) { 117 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
120 if (mn->ops->test_young) { 118 if (mn->ops->test_young) {
121 young = mn->ops->test_young(mn, mm, address); 119 young = mn->ops->test_young(mn, mm, address);
122 if (young) 120 if (young)
@@ -132,11 +130,10 @@ void __mmu_notifier_change_pte(struct mm_struct *mm, unsigned long address,
132 pte_t pte) 130 pte_t pte)
133{ 131{
134 struct mmu_notifier *mn; 132 struct mmu_notifier *mn;
135 struct hlist_node *n;
136 int id; 133 int id;
137 134
138 id = srcu_read_lock(&srcu); 135 id = srcu_read_lock(&srcu);
139 hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) { 136 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
140 if (mn->ops->change_pte) 137 if (mn->ops->change_pte)
141 mn->ops->change_pte(mn, mm, address, pte); 138 mn->ops->change_pte(mn, mm, address, pte);
142 } 139 }
@@ -147,11 +144,10 @@ void __mmu_notifier_invalidate_page(struct mm_struct *mm,
147 unsigned long address) 144 unsigned long address)
148{ 145{
149 struct mmu_notifier *mn; 146 struct mmu_notifier *mn;
150 struct hlist_node *n;
151 int id; 147 int id;
152 148
153 id = srcu_read_lock(&srcu); 149 id = srcu_read_lock(&srcu);
154 hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) { 150 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
155 if (mn->ops->invalidate_page) 151 if (mn->ops->invalidate_page)
156 mn->ops->invalidate_page(mn, mm, address); 152 mn->ops->invalidate_page(mn, mm, address);
157 } 153 }
@@ -162,11 +158,10 @@ void __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
162 unsigned long start, unsigned long end) 158 unsigned long start, unsigned long end)
163{ 159{
164 struct mmu_notifier *mn; 160 struct mmu_notifier *mn;
165 struct hlist_node *n;
166 int id; 161 int id;
167 162
168 id = srcu_read_lock(&srcu); 163 id = srcu_read_lock(&srcu);
169 hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) { 164 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
170 if (mn->ops->invalidate_range_start) 165 if (mn->ops->invalidate_range_start)
171 mn->ops->invalidate_range_start(mn, mm, start, end); 166 mn->ops->invalidate_range_start(mn, mm, start, end);
172 } 167 }
@@ -178,11 +173,10 @@ void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
178 unsigned long start, unsigned long end) 173 unsigned long start, unsigned long end)
179{ 174{
180 struct mmu_notifier *mn; 175 struct mmu_notifier *mn;
181 struct hlist_node *n;
182 int id; 176 int id;
183 177
184 id = srcu_read_lock(&srcu); 178 id = srcu_read_lock(&srcu);
185 hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) { 179 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
186 if (mn->ops->invalidate_range_end) 180 if (mn->ops->invalidate_range_end)
187 mn->ops->invalidate_range_end(mn, mm, start, end); 181 mn->ops->invalidate_range_end(mn, mm, start, end);
188 } 182 }