Commit 1ff6fee5 authored by Oleg Nesterov's avatar Oleg Nesterov

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: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
parent e591c8d7
...@@ -614,14 +614,19 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file, ...@@ -614,14 +614,19 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file,
static bool filter_chain(struct uprobe *uprobe) static bool filter_chain(struct uprobe *uprobe)
{ {
/* struct uprobe_consumer *uc;
* TODO: bool ret = false;
* for_each_consumer(uc)
* if (uc->filter(...)) down_read(&uprobe->consumer_rwsem);
* return true; for (uc = uprobe->consumers; uc; uc = uc->next) {
* return false; /* TODO: ret = uc->filter(...) */
*/ ret = true;
return uprobe->consumers != NULL; if (ret)
break;
}
up_read(&uprobe->consumer_rwsem);
return ret;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment