History

mm/mmu_notifier: convert mmu_notifier_range->blockable to a flags

Use an unsigned field for flags other than blockable and convert the blockable field to be one of those flags.

Jérôme Glisse committed 7 years ago

Commit 27560ee1 parent dfcd6661 file · +7 −4Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/mmu_notifier.h+7−4
@@ -25,11 +25,13 @@ struct mmu_notifier_mm { · 24 unmodified lines
25 spinlock_t lock;25 spinlock_t lock;
26};26};
27 27
28#define MMU_NOTIFIER_RANGE_BLOCKABLE (1 << 0)
29
28struct mmu_notifier_range {30struct mmu_notifier_range {
29 struct mm_struct *mm;31 struct mm_struct *mm;
30 unsigned long start;32 unsigned long start;
31 unsigned long end;33 unsigned long end;
32 bool blockable;34 unsigned flags;
33};35};
34 36
35struct mmu_notifier_ops {37struct mmu_notifier_ops {
@@ -229,7 +231,7 @@ extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, · 193 unmodified lines
229static inline bool231static inline bool
230mmu_notifier_range_blockable(const struct mmu_notifier_range *range)232mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
231{233{
232 return range->blockable;234 return (range->flags & MMU_NOTIFIER_RANGE_BLOCKABLE);
233}235}
234 236
235static inline void mmu_notifier_release(struct mm_struct *mm)237static inline void mmu_notifier_release(struct mm_struct *mm)
@@ -275,7 +277,7 @@ static inline void · 39 unmodified lines
275mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)277mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
276{278{
277 if (mm_has_notifiers(range->mm)) {279 if (mm_has_notifiers(range->mm)) {
278 range->blockable = true;280 range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE;
279 __mmu_notifier_invalidate_range_start(range);281 __mmu_notifier_invalidate_range_start(range);
280 }282 }
281}283}
@@ -284,7 +286,7 @@ static inline int · 2 unmodified lines
284mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)286mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)
285{287{
286 if (mm_has_notifiers(range->mm)) {288 if (mm_has_notifiers(range->mm)) {
287 range->blockable = false;289 range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE;
288 return __mmu_notifier_invalidate_range_start(range);290 return __mmu_notifier_invalidate_range_start(range);
289 }291 }
290 return 0;292 return 0;
@@ -331,6 +333,7 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, · 40 unmodified lines
331 range->mm = mm;333 range->mm = mm;
332 range->start = start;334 range->start = start;
333 range->end = end;335 range->end = end;
336 range->flags = 0;
334}337}
335 338
336#define ptep_clear_flush_young_notify(__vma, __address, __ptep) \339#define ptep_clear_flush_young_notify(__vma, __address, __ptep) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t