diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index f01b7eed6e16..0a2010a9518c 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3075,3 +3075,18 @@ void print_vma_addr(char *prefix, unsigned long ip) | |||
3075 | } | 3075 | } |
3076 | up_read(¤t->mm->mmap_sem); | 3076 | up_read(¤t->mm->mmap_sem); |
3077 | } | 3077 | } |
3078 | |||
3079 | #ifdef CONFIG_PROVE_LOCKING | ||
3080 | void might_fault(void) | ||
3081 | { | ||
3082 | might_sleep(); | ||
3083 | /* | ||
3084 | * it would be nicer only to annotate paths which are not under | ||
3085 | * pagefault_disable, however that requires a larger audit and | ||
3086 | * providing helpers like get_user_atomic. | ||
3087 | */ | ||
3088 | if (!in_atomic() && current->mm) | ||
3089 | might_lock_read(¤t->mm->mmap_sem); | ||
3090 | } | ||
3091 | EXPORT_SYMBOL(might_fault); | ||
3092 | #endif | ||