Use an unsigned field for flags other than blockable and convert the blockable field to be one of those flags.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -25,11 +25,13 @@ struct mmu_notifier_mm { · 24 unmodified lines | ||
| 25 | 25 | spinlock_t lock; |
| 26 | 26 | }; |
| 27 | 27 | |
| 28 | +#define MMU_NOTIFIER_RANGE_BLOCKABLE (1 << 0) | |
| 29 | + | |
| 28 | 30 | struct mmu_notifier_range { |
| 29 | 31 | struct mm_struct *mm; |
| 30 | 32 | unsigned long start; |
| 31 | 33 | unsigned long end; |
| 32 | − bool blockable; | |
| 34 | + unsigned flags; | |
| 33 | 35 | }; |
| 34 | 36 | |
| 35 | 37 | struct mmu_notifier_ops { |
| @@ -229,7 +231,7 @@ extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, · 193 unmodified lines | ||
| 229 | 231 | static inline bool |
| 230 | 232 | mmu_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 | |
| 235 | 237 | static inline void mmu_notifier_release(struct mm_struct *mm) |
| @@ -275,7 +277,7 @@ static inline void · 39 unmodified lines | ||
| 275 | 277 | mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range) |
| 276 | 278 | { |
| 277 | 279 | if (mm_has_notifiers(range->mm)) { |
| 278 | − range->blockable = true; | |
| 280 | + range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE; | |
| 279 | 281 | __mmu_notifier_invalidate_range_start(range); |
| 280 | 282 | } |
| 281 | 283 | } |
| @@ -284,7 +286,7 @@ static inline int · 2 unmodified lines | ||
| 284 | 286 | mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range) |
| 285 | 287 | { |
| 286 | 288 | if (mm_has_notifiers(range->mm)) { |
| 287 | − range->blockable = false; | |
| 289 | + range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE; | |
| 288 | 290 | return __mmu_notifier_invalidate_range_start(range); |
| 289 | 291 | } |
| 290 | 292 | return 0; |
| @@ -331,6 +333,7 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, · 40 unmodified lines | ||
| 331 | 333 | range->mm = mm; |
| 332 | 334 | range->start = start; |
| 333 | 335 | range->end = end; |
| 336 | + range->flags = 0; | |
| 334 | 337 | } |
| 335 | 338 | |
| 336 | 339 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ |