.. | .. |
---|
91 | 91 | struct mm_struct *mm = current->mm; |
---|
92 | 92 | struct vm_area_struct *mpnt; |
---|
93 | 93 | |
---|
94 | | - down_read(&mm->mmap_sem); |
---|
| 94 | + mmap_read_lock(mm); |
---|
95 | 95 | |
---|
96 | 96 | mpnt = find_vma(mm, addr); |
---|
97 | 97 | if (mpnt && mpnt->vm_file && (mpnt->vm_flags & VM_EXEC)) { |
---|
98 | | - up_read(&mm->mmap_sem); |
---|
| 98 | + mmap_read_unlock(mm); |
---|
99 | 99 | /* To avoid latency problems, we only process the current CPU, |
---|
100 | 100 | * hoping that most samples for the task are on this CPU |
---|
101 | 101 | */ |
---|
.. | .. |
---|
103 | 103 | return 0; |
---|
104 | 104 | } |
---|
105 | 105 | |
---|
106 | | - up_read(&mm->mmap_sem); |
---|
| 106 | + mmap_read_unlock(mm); |
---|
107 | 107 | return 0; |
---|
108 | 108 | } |
---|
109 | 109 | |
---|
.. | .. |
---|
116 | 116 | { |
---|
117 | 117 | #ifdef CONFIG_MODULES |
---|
118 | 118 | if (val != MODULE_STATE_COMING) |
---|
119 | | - return 0; |
---|
| 119 | + return NOTIFY_DONE; |
---|
120 | 120 | |
---|
121 | 121 | /* FIXME: should we process all CPU buffers ? */ |
---|
122 | 122 | mutex_lock(&buffer_mutex); |
---|
.. | .. |
---|
124 | 124 | add_event_entry(MODULE_LOADED_CODE); |
---|
125 | 125 | mutex_unlock(&buffer_mutex); |
---|
126 | 126 | #endif |
---|
127 | | - return 0; |
---|
| 127 | + return NOTIFY_OK; |
---|
128 | 128 | } |
---|
129 | 129 | |
---|
130 | 130 | |
---|
.. | .. |
---|
256 | 256 | unsigned long cookie = NO_COOKIE; |
---|
257 | 257 | struct vm_area_struct *vma; |
---|
258 | 258 | |
---|
259 | | - down_read(&mm->mmap_sem); |
---|
| 259 | + mmap_read_lock(mm); |
---|
260 | 260 | for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) { |
---|
261 | 261 | |
---|
262 | 262 | if (addr < vma->vm_start || addr >= vma->vm_end) |
---|
.. | .. |
---|
276 | 276 | |
---|
277 | 277 | if (!vma) |
---|
278 | 278 | cookie = INVALID_COOKIE; |
---|
279 | | - up_read(&mm->mmap_sem); |
---|
| 279 | + mmap_read_unlock(mm); |
---|
280 | 280 | |
---|
281 | 281 | return cookie; |
---|
282 | 282 | } |
---|
.. | .. |
---|
486 | 486 | |
---|
487 | 487 | /* Sync one of the CPU's buffers into the global event buffer. |
---|
488 | 488 | * Here we need to go through each batch of samples punctuated |
---|
489 | | - * by context switch notes, taking the task's mmap_sem and doing |
---|
| 489 | + * by context switch notes, taking the task's mmap_lock and doing |
---|
490 | 490 | * lookup in task->mm->mmap to convert EIP into dcookie/offset |
---|
491 | 491 | * value. |
---|
492 | 492 | */ |
---|