aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-11-24 12:15:46 -0500
committerOleg Nesterov <oleg@redhat.com>2013-02-08 11:47:05 -0500
commit1ff6fee5e62c57d5923b805bb4206acb7953f16e (patch)
tree1b573238a506824e34d19b7ae5cba604d00f7b5c /kernel/events
parente591c8d78e49e6206935cf31c4d2b603bbb29166 (diff)
uprobes: Change filter_chain() to iterate ->consumers list
Now that it safe to use ->consumer_rwsem under ->mmap_sem we can almost finish the implementation of filter_chain(). It still lacks the actual uc->filter(...) call but othewrwise it is ready, just it pretends that ->filter() always returns true. 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.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 61d0fa6b5012..4d0452363686 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -614,14 +614,19 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file,
614 614
615static bool filter_chain(struct uprobe *uprobe) 615static bool filter_chain(struct uprobe *uprobe)
616{ 616{
617 /* 617 struct uprobe_consumer *uc;
618 * TODO: 618 bool ret = false;
619 * for_each_consumer(uc) 619
620 * if (uc->filter(...)) 620 down_read(&uprobe->consumer_rwsem);
621 * return true; 621 for (uc = uprobe->consumers; uc; uc = uc->next) {
622 * return false; 622 /* TODO: ret = uc->filter(...) */
623 */ 623 ret = true;
624 return uprobe->consumers != NULL; 624 if (ret)
625 break;
626 }
627 up_read(&uprobe->consumer_rwsem);
628
629 return ret;
625} 630}
626 631
627static int 632static int