lkml.org 
[lkml]   [2005]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Remove nonsensical list function list_for_each_safe_rcu
From
Date
Name: Remove nonsensical list function
Status: Trivial
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

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.

Index: linux-2.6.11-rc1-bk5-Misc/Documentation/RCU/checklist.txt
===================================================================
--- linux-2.6.11-rc1-bk5-Misc.orig/Documentation/RCU/checklist.txt 2005-01-18 17:20:56.484344256 +1100
+++ linux-2.6.11-rc1-bk5-Misc/Documentation/RCU/checklist.txt 2005-01-18 17:21:12.846856776 +1100
@@ -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
Index: linux-2.6.11-rc1-bk5-Misc/include/linux/list.h
===================================================================
--- linux-2.6.11-rc1-bk5-Misc.orig/include/linux/list.h 2005-01-18 17:18:39.394185128 +1100
+++ linux-2.6.11-rc1-bk5-Misc/include/linux/list.h 2005-01-18 17:19:47.098892448 +1100
@@ -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.
--
A bad analogy is like a leaky screwdriver -- Richard Braakman

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

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.024 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site