Re: [PATCH v5 3.1.0-rc4-tip 2/26] Uprobes: Allow multipleconsumers for an uprobe.

From: Peter Zijlstra
Date: Mon Sep 26 2011 - 08:30:24 EST


On Tue, 2011-09-20 at 17:30 +0530, Srikar Dronamraju wrote:
> + con = uprobe->consumers;
> + if (consumer == con) {
> + uprobe->consumers = con->next;
> + ret = true;
> + } else {
> + for (; con; con = con->next) {
> + if (con->next == consumer) {
> + con->next = consumer->next;
> + ret = true;
> + break;
> + }
> + }
> + }

struct uprobe_consumer **next = &uprobe->consumers;

for (; *next; next = &(*next)->next) {
if (*next == consumer) {
*next = (*next)->next;
ret = true;
break;
}
}

Wouldn't something like that work?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/