[PATCH] Add list_for_each_rcu to features-removal list

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: <davem@...>, <dipankar@...>
Date: Monday, January 28, 2008 - 8:25 am

Hello!

The list_for_each_entry_rcu() primitive should be used instead of
list_for_each_rcu(), as the former is easier to use and provides
better type safety.  This patch therefore adds list_for_each_rcu()
to the Documentation/feature-removal-schedule.txt file (for mid-2008)
and marks its comment header deprecated.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---

 Documentation/feature-removal-schedule.txt |   10 ++++++++++
 include/linux/list.h                       |    5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff -urpNa -X dontdiff linux-2.6.24/Documentation/feature-removal-schedule.txt linux-2.6.24-dep-lfeRCU/Documentation/feature-removal-schedule.txt
--- linux-2.6.24/Documentation/feature-removal-schedule.txt	2008-01-24 14:58:37.000000000 -0800
+++ linux-2.6.24-dep-lfeRCU/Documentation/feature-removal-schedule.txt	2008-01-28 04:00:49.000000000 -0800
@@ -333,3 +333,13 @@ Why:	This driver has been marked obsolet
 Who:	Stephen Hemminger <shemminger@linux-foundation.org>
 
 ---------------------------
+
+What:	list_for_each_rcu() primitive
+When:	July 2008
+Files:	include/linux/list.h
+Why:	The list_for_each_entry_rcu() primitive should be used instead,
+	as it is less error-prone and provides better type safety.
+Who:	Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+
+---------------------------
+
diff -urpNa -X dontdiff linux-2.6.24/include/linux/list.h linux-2.6.24-dep-lfeRCU/include/linux/list.h
--- linux-2.6.24/include/linux/list.h	2008-01-24 14:58:37.000000000 -0800
+++ linux-2.6.24-dep-lfeRCU/include/linux/list.h	2008-01-28 04:06:52.000000000 -0800
@@ -622,13 +622,16 @@ static inline void list_splice_init_rcu(
 	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
 
 /**
- * list_for_each_rcu	-	iterate over an rcu-protected list
+ * list_for_each_rcu - iterate over an rcu-protected list: DEPRECATED
  * @pos:	the &struct list_head to use as a loop cursor.
  * @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().
+ *
+ * DEPRECATED: please use list_for_each_entry_rcu() instead: it is
+ * easier to use and also provides better type safety.
  */
 #define list_for_each_rcu(pos, head) \
 	for (pos = (head)->next; \
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Add list_for_each_rcu to features-removal list, Paul E. McKenney, (Mon Jan 28, 8:25 am)
Re: [PATCH] Add list_for_each_rcu to features-removal list, Paul E. McKenney, (Sat Feb 16, 12:19 pm)