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
2525 spinlock_t lock;
2626 };
2727
28+#define MMU_NOTIFIER_RANGE_BLOCKABLE (1 << 0)
29+
2830 struct mmu_notifier_range {
2931 struct mm_struct *mm;
3032 unsigned long start;
3133 unsigned long end;
32− bool blockable;
34+ unsigned flags;
3335 };
3436
3537 struct mmu_notifier_ops {
@@ -229,7 +231,7 @@ extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, · 193 unmodified lines
229231 static inline bool
230232 mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
231233 {
232− return range->blockable;
234+ return (range->flags & MMU_NOTIFIER_RANGE_BLOCKABLE);
233235 }
234236
235237 static inline void mmu_notifier_release(struct mm_struct *mm)
@@ -275,7 +277,7 @@ static inline void · 39 unmodified lines
275277 mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
276278 {
277279 if (mm_has_notifiers(range->mm)) {
278− range->blockable = true;
280+ range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE;
279281 __mmu_notifier_invalidate_range_start(range);
280282 }
281283 }
@@ -284,7 +286,7 @@ static inline int · 2 unmodified lines
284286 mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)
285287 {
286288 if (mm_has_notifiers(range->mm)) {
287− range->blockable = false;
289+ range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE;
288290 return __mmu_notifier_invalidate_range_start(range);
289291 }
290292 return 0;
@@ -331,6 +333,7 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, · 40 unmodified lines
331333 range->mm = mm;
332334 range->start = start;
333335 range->end = end;
336+ range->flags = 0;
334337 }
335338
336339 #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