Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320478
b: refs/heads/master
c: cb113b4
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jul 30, 2012
1 parent e00fa6a commit 32d095e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 891c39708144bbe401b4aa151bffd0fe41b1dafd
refs/heads/master: cb113b47d098185f3f1f67e8300d05ddce842b66
14 changes: 8 additions & 6 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ static loff_t vma_address(struct vm_area_struct *vma, loff_t offset)
return vaddr;
}

static loff_t vaddr_to_offset(struct vm_area_struct *vma, unsigned long vaddr)
{
return ((loff_t)vma->vm_pgoff << PAGE_SHIFT) + (vaddr - vma->vm_start);
}

/**
* __replace_page - replace page in vma by new page.
* based on replace_page in mm/ksm.c
Expand Down Expand Up @@ -978,7 +983,7 @@ static void build_probe_list(struct inode *inode,
struct uprobe *u;

INIT_LIST_HEAD(head);
min = ((loff_t)vma->vm_pgoff << PAGE_SHIFT) + start - vma->vm_start;
min = vaddr_to_offset(vma, start);
max = min + (end - start) - 1;

spin_lock_irqsave(&uprobes_treelock, flags);
Expand Down Expand Up @@ -1442,12 +1447,9 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
vma = find_vma(mm, bp_vaddr);
if (vma && vma->vm_start <= bp_vaddr) {
if (valid_vma(vma, false)) {
struct inode *inode;
loff_t offset;
struct inode *inode = vma->vm_file->f_mapping->host;
loff_t offset = vaddr_to_offset(vma, bp_vaddr);

inode = vma->vm_file->f_mapping->host;
offset = bp_vaddr - vma->vm_start;
offset += (loff_t)vma->vm_pgoff << PAGE_SHIFT;
uprobe = find_uprobe(inode, offset);
}

Expand Down

0 comments on commit 32d095e

Please sign in to comment.