lkml.org 
[lkml]   [2011]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 3.1.0-rc4-tip 2/26] Uprobes: Allow multiple consumers for an uprobe.
From
Date
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?


\
 
 \ /
  Last update: 2011-09-26 14:33    [W:0.394 / U:2.108 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site