diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/oprofile/cell/spu_task_sync.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/powerpc/oprofile/cell/spu_task_sync.c b/arch/powerpc/oprofile/cell/spu_task_sync.c index 1c27831df1ac..ed7b0977072a 100644 --- a/arch/powerpc/oprofile/cell/spu_task_sync.c +++ b/arch/powerpc/oprofile/cell/spu_task_sync.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/kref.h> | 22 | #include <linux/kref.h> |
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
25 | #include <linux/file.h> | ||
25 | #include <linux/module.h> | 26 | #include <linux/module.h> |
26 | #include <linux/notifier.h> | 27 | #include <linux/notifier.h> |
27 | #include <linux/numa.h> | 28 | #include <linux/numa.h> |
@@ -322,18 +323,20 @@ get_exec_dcookie_and_offset(struct spu *spu, unsigned int *offsetp, | |||
322 | unsigned long app_cookie = 0; | 323 | unsigned long app_cookie = 0; |
323 | unsigned int my_offset = 0; | 324 | unsigned int my_offset = 0; |
324 | struct vm_area_struct *vma; | 325 | struct vm_area_struct *vma; |
326 | struct file *exe_file; | ||
325 | struct mm_struct *mm = spu->mm; | 327 | struct mm_struct *mm = spu->mm; |
326 | 328 | ||
327 | if (!mm) | 329 | if (!mm) |
328 | goto out; | 330 | goto out; |
329 | 331 | ||
330 | down_read(&mm->mmap_sem); | 332 | exe_file = get_mm_exe_file(mm); |
331 | 333 | if (exe_file) { | |
332 | if (mm->exe_file) { | 334 | app_cookie = fast_get_dcookie(&exe_file->f_path); |
333 | app_cookie = fast_get_dcookie(&mm->exe_file->f_path); | 335 | pr_debug("got dcookie for %pD\n", exe_file); |
334 | pr_debug("got dcookie for %pD\n", mm->exe_file); | 336 | fput(exe_file); |
335 | } | 337 | } |
336 | 338 | ||
339 | down_read(&mm->mmap_sem); | ||
337 | for (vma = mm->mmap; vma; vma = vma->vm_next) { | 340 | for (vma = mm->mmap; vma; vma = vma->vm_next) { |
338 | if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref) | 341 | if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref) |
339 | continue; | 342 | continue; |