diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-03-17 13:54:44 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-04-04 07:57:03 -0400 |
commit | f281769e81b49840f1857f6dfac049350e678350 (patch) | |
tree | 325e53ee508463f95d2be119c9afa45fe3e45b5e /kernel/events | |
parent | b847d0501afec4c7b12eb276aec10a2834f953ea (diff) |
uprobes: Use file_inode()
Cleanup. Now that we have f_inode/file_inode() we can use it instead
of vm_file->f_mapping->host.
This should not make any difference for uprobes, but in theory this
change is more correct. We use this inode as a key, to compare it
with uprobe->inode set by uprobe_register(inode), and the caller uses
d_inode.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/uprobes.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index a567c8c7ef31..26bc2e24e9e3 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -758,7 +758,7 @@ register_for_each_vma(struct uprobe *uprobe, struct uprobe_consumer *new) | |||
758 | down_write(&mm->mmap_sem); | 758 | down_write(&mm->mmap_sem); |
759 | vma = find_vma(mm, info->vaddr); | 759 | vma = find_vma(mm, info->vaddr); |
760 | if (!vma || !valid_vma(vma, is_register) || | 760 | if (!vma || !valid_vma(vma, is_register) || |
761 | vma->vm_file->f_mapping->host != uprobe->inode) | 761 | file_inode(vma->vm_file) != uprobe->inode) |
762 | goto unlock; | 762 | goto unlock; |
763 | 763 | ||
764 | if (vma->vm_start > info->vaddr || | 764 | if (vma->vm_start > info->vaddr || |
@@ -917,7 +917,7 @@ static int unapply_uprobe(struct uprobe *uprobe, struct mm_struct *mm) | |||
917 | loff_t offset; | 917 | loff_t offset; |
918 | 918 | ||
919 | if (!valid_vma(vma, false) || | 919 | if (!valid_vma(vma, false) || |
920 | vma->vm_file->f_mapping->host != uprobe->inode) | 920 | file_inode(vma->vm_file) != uprobe->inode) |
921 | continue; | 921 | continue; |
922 | 922 | ||
923 | offset = (loff_t)vma->vm_pgoff << PAGE_SHIFT; | 923 | offset = (loff_t)vma->vm_pgoff << PAGE_SHIFT; |
@@ -1010,7 +1010,7 @@ int uprobe_mmap(struct vm_area_struct *vma) | |||
1010 | if (no_uprobe_events() || !valid_vma(vma, true)) | 1010 | if (no_uprobe_events() || !valid_vma(vma, true)) |
1011 | return 0; | 1011 | return 0; |
1012 | 1012 | ||
1013 | inode = vma->vm_file->f_mapping->host; | 1013 | inode = file_inode(vma->vm_file); |
1014 | if (!inode) | 1014 | if (!inode) |
1015 | return 0; | 1015 | return 0; |
1016 | 1016 | ||
@@ -1041,7 +1041,7 @@ vma_has_uprobes(struct vm_area_struct *vma, unsigned long start, unsigned long e | |||
1041 | struct inode *inode; | 1041 | struct inode *inode; |
1042 | struct rb_node *n; | 1042 | struct rb_node *n; |
1043 | 1043 | ||
1044 | inode = vma->vm_file->f_mapping->host; | 1044 | inode = file_inode(vma->vm_file); |
1045 | 1045 | ||
1046 | min = vaddr_to_offset(vma, start); | 1046 | min = vaddr_to_offset(vma, start); |
1047 | max = min + (end - start) - 1; | 1047 | max = min + (end - start) - 1; |
@@ -1465,7 +1465,7 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp) | |||
1465 | vma = find_vma(mm, bp_vaddr); | 1465 | vma = find_vma(mm, bp_vaddr); |
1466 | if (vma && vma->vm_start <= bp_vaddr) { | 1466 | if (vma && vma->vm_start <= bp_vaddr) { |
1467 | if (valid_vma(vma, false)) { | 1467 | if (valid_vma(vma, false)) { |
1468 | struct inode *inode = vma->vm_file->f_mapping->host; | 1468 | struct inode *inode = file_inode(vma->vm_file); |
1469 | loff_t offset = vaddr_to_offset(vma, bp_vaddr); | 1469 | loff_t offset = vaddr_to_offset(vma, bp_vaddr); |
1470 | 1470 | ||
1471 | uprobe = find_uprobe(inode, offset); | 1471 | uprobe = find_uprobe(inode, offset); |