Thread (160 messages) 160 messages, 9 authors, 2011-10-25

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

From: Peter Zijlstra <peterz@infradead.org>
Date: 2011-09-26 12:30:23
Also in: lkml

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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help