Thread (15 messages) 15 messages, 4 authors, 2015-12-09

Re: [PATCH net-next v2 2/5] rhashtable: add function to replace an element

From: David Miller <davem@davemloft.net>
Date: 2015-12-03 19:46:00

From: Tom Herbert <redacted>
Date: Tue, 1 Dec 2015 15:11:09 -0800
+	lock = rht_bucket_lock(tbl, hash);
+
+	spin_lock_bh(lock);
+
+	pprev = &tbl->buckets[hash];
+	rht_for_each(he, tbl, hash) {
+		if (he != obj_old) {
+			pprev = &he->next;
+			continue;
+		}
+
+		rcu_assign_pointer(obj_new->next, obj_old->next);
+		rcu_assign_pointer(*pprev, obj_new);
+		err = 0;
+		break;
Are you sure this works fine in the presence of both parallel readers and
table expansion passes?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help