Skip to contentSkip to conversation

Remove nonsensical list function list_for_each_safe_rcu

PATCH New Rusty Russell 1 participant 1 message Jan 18, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove nonsensical list function list_for_each_safe_rcu

Name: Remove nonsensical list function
Status: Trivial

The correct use of list_for_each_safe_rcu is a coding puzzle which minor minds such mine are not capable of solving. Please remove this obstacle on my path to enlightenment.

Documentation/RCU/checklist.txt +5 -5
Index: linux-2.6.11-rc1-bk5-Misc/Documentation/RCU/checklist.txt
===================================================================
@@ -132,11 +132,11 @@
 
 9.	All RCU list-traversal primitives, which include
 	list_for_each_rcu(), list_for_each_entry_rcu(),
-	list_for_each_continue_rcu(), and list_for_each_safe_rcu(),
-	must be within an RCU read-side critical section.  RCU
-	read-side critical sections are delimited by rcu_read_lock()
-	and rcu_read_unlock(), or by similar primitives such as
-	rcu_read_lock_bh() and rcu_read_unlock_bh().
+	and list_for_each_continue_rcu(), must be within an RCU
+	read-side critical section.  RCU read-side critical sections
+	are delimited by rcu_read_lock() and rcu_read_unlock(), or by
+	similar primitives such as rcu_read_lock_bh()
+	and rcu_read_unlock_bh().
 
 	Use of the _rcu() list-traversal primitives outside of an
 	RCU read-side critical section causes no harm other than
include/linux/list.h +0 -15
Index: linux-2.6.11-rc1-bk5-Misc/include/linux/list.h
===================================================================
@@ -436,21 +436,6 @@
         	pos = rcu_dereference(pos->next))
 
 /**
- * list_for_each_safe_rcu	-	iterate over an rcu-protected list safe
- *					against removal of list entry
- * @pos:	the &struct list_head to use as a loop counter.
- * @n:		another &struct list_head to use as temporary storage
- * @head:	the head for your list.
- *
- * This list-traversal primitive may safely run concurrently with
- * the _rcu list-mutation primitives such as list_add_rcu()
- * as long as the traversal is guarded by rcu_read_lock().
- */
-#define list_for_each_safe_rcu(pos, n, head) \
-	for (pos = (head)->next, n = pos->next; pos != (head); \
-		pos = rcu_dereference(n), n = pos->next)
-
-/**
  * list_for_each_entry_rcu	-	iterate over rcu list of given type
  * @pos:	the type * to use as a loop counter.
  * @head:	the head for your list.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman