aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2012-10-25 10:42:03 +0100
committerJon Medhurst <tixy@linaro.org>2012-10-25 16:23:23 +0100
commitf42e1d03f7c3f828a739030d642f39cee9ab8e76 (patch)
tree8a97578aadcbc2ed8a0f9cfa4d3dd51e8a10f9ae
parent3c20964f4093fedb7ff93d35e5693c3a6d929f16 (diff)
downloadvexpress-lsk-f42e1d03f7c3f828a739030d642f39cee9ab8e76.tar.gz
gator: Stop using VM_EXECUTABLE
In Linux 3.7, commit e9714acf (mm: kill vma flag VM_EXECUTABLE and mm->num_exe_file_vmas) breaks Gator's get_exec_cookie() as it uses the removed flag. Fix this in a similar as commit 2dd8ad81 (mm: use mm->exe_file instead of first VM_EXECUTABLE vma->vm_file) Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--drivers/gator/gator_cookies.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gator/gator_cookies.c b/drivers/gator/gator_cookies.c
index b2ed6866532..21dc4eb1ad3 100644
--- a/drivers/gator/gator_cookies.c
+++ b/drivers/gator/gator_cookies.c
@@ -232,10 +232,13 @@ static inline uint32_t get_cookie(int cpu, struct task_struct *task, struct vm_a
if (mod) {
text = mod->name;
} else {
- if (!vma || !vma->vm_file) {
+ if (vma && vma->vm_file) {
+ path = &vma->vm_file->f_path;
+ } else if (task && task->mm && task->mm->exe_file) {
+ path = &task->mm->exe_file->f_path;
+ } else {
return INVALID_COOKIE;
}
- path = &vma->vm_file->f_path;
if (!path || !path->dentry) {
return INVALID_COOKIE;
}
@@ -275,20 +278,12 @@ static int get_exec_cookie(int cpu, struct task_struct *task)
{
unsigned long cookie = NO_COOKIE;
struct mm_struct *mm = task->mm;
- struct vm_area_struct *vma;
// kernel threads have no address space
if (!mm)
return cookie;
- for (vma = mm->mmap; vma; vma = vma->vm_next) {
- if (!vma->vm_file)
- continue;
- if (!(vma->vm_flags & VM_EXECUTABLE))
- continue;
- cookie = get_cookie(cpu, task, vma, NULL, true);
- break;
- }
+ cookie = get_cookie(cpu, task, NULL, NULL, true);
return cookie;
}