Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323844
b: refs/heads/master
c: 6f47caa
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov committed Sep 15, 2012
1 parent 95e22e9 commit 063d113
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 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: 6d1d8dfa8b65831cfa9a528e3d17efa7e7f4226c
refs/heads/master: 6f47caa0e1e4887aa2ddca8388d058d35725d815
21 changes: 8 additions & 13 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,10 @@ static struct uprobe *__find_uprobe(struct inode *inode, loff_t offset)
static struct uprobe *find_uprobe(struct inode *inode, loff_t offset)
{
struct uprobe *uprobe;
unsigned long flags;

spin_lock_irqsave(&uprobes_treelock, flags);
spin_lock(&uprobes_treelock);
uprobe = __find_uprobe(inode, offset);
spin_unlock_irqrestore(&uprobes_treelock, flags);
spin_unlock(&uprobes_treelock);

return uprobe;
}
Expand Down Expand Up @@ -462,12 +461,11 @@ static struct uprobe *__insert_uprobe(struct uprobe *uprobe)
*/
static struct uprobe *insert_uprobe(struct uprobe *uprobe)
{
unsigned long flags;
struct uprobe *u;

spin_lock_irqsave(&uprobes_treelock, flags);
spin_lock(&uprobes_treelock);
u = __insert_uprobe(uprobe);
spin_unlock_irqrestore(&uprobes_treelock, flags);
spin_unlock(&uprobes_treelock);

/* For now assume that the instruction need not be single-stepped */
uprobe->flags |= UPROBE_SKIP_SSTEP;
Expand Down Expand Up @@ -705,11 +703,9 @@ remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vad
*/
static void delete_uprobe(struct uprobe *uprobe)
{
unsigned long flags;

spin_lock_irqsave(&uprobes_treelock, flags);
spin_lock(&uprobes_treelock);
rb_erase(&uprobe->rb_node, &uprobes_tree);
spin_unlock_irqrestore(&uprobes_treelock, flags);
spin_unlock(&uprobes_treelock);
iput(uprobe->inode);
put_uprobe(uprobe);
atomic_dec(&uprobe_events);
Expand Down Expand Up @@ -968,15 +964,14 @@ static void build_probe_list(struct inode *inode,
struct list_head *head)
{
loff_t min, max;
unsigned long flags;
struct rb_node *n, *t;
struct uprobe *u;

INIT_LIST_HEAD(head);
min = vaddr_to_offset(vma, start);
max = min + (end - start) - 1;

spin_lock_irqsave(&uprobes_treelock, flags);
spin_lock(&uprobes_treelock);
n = find_node_in_range(inode, min, max);
if (n) {
for (t = n; t; t = rb_prev(t)) {
Expand All @@ -994,7 +989,7 @@ static void build_probe_list(struct inode *inode,
atomic_inc(&u->ref);
}
}
spin_unlock_irqrestore(&uprobes_treelock, flags);
spin_unlock(&uprobes_treelock);
}

/*
Expand Down

0 comments on commit 063d113

Please sign in to comment.