diff options
author | Paul E. McKenney <paulmck@us.ibm.com> | 2005-11-07 03:59:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:35 -0500 |
commit | 665a7583f32ab5b3bfe7a4d88da506542f7cdd75 (patch) | |
tree | 2b45def3f7ecaf322b05622a635510fe8aef51af /include/linux/list.h | |
parent | 9f46080c41d5f3f7c00b4e169ba4b0b2865258bf (diff) |
[PATCH] Remove hlist_for_each_rcu() API, convert existing use to hlist_for_each_entry_rcu
Remove the hlist_for_each_rcu() API, which is used only in one place, and
is trivially converted to hlist_for_each_entry_rcu(), making the code
shorter and more readable. Any out-of-tree uses may be similarly
converted.
Signed-off-by: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 084971f333fe..fbfca73355a3 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -601,7 +601,7 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) | |||
601 | * or hlist_del_rcu(), running on this same list. | 601 | * or hlist_del_rcu(), running on this same list. |
602 | * However, it is perfectly legal to run concurrently with | 602 | * However, it is perfectly legal to run concurrently with |
603 | * the _rcu list-traversal primitives, such as | 603 | * the _rcu list-traversal primitives, such as |
604 | * hlist_for_each_rcu(), used to prevent memory-consistency | 604 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
605 | * problems on Alpha CPUs. Regardless of the type of CPU, the | 605 | * problems on Alpha CPUs. Regardless of the type of CPU, the |
606 | * list-traversal primitive must be guarded by rcu_read_lock(). | 606 | * list-traversal primitive must be guarded by rcu_read_lock(). |
607 | */ | 607 | */ |
@@ -650,7 +650,7 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
650 | * or hlist_del_rcu(), running on this same list. | 650 | * or hlist_del_rcu(), running on this same list. |
651 | * However, it is perfectly legal to run concurrently with | 651 | * However, it is perfectly legal to run concurrently with |
652 | * the _rcu list-traversal primitives, such as | 652 | * the _rcu list-traversal primitives, such as |
653 | * hlist_for_each_rcu(), used to prevent memory-consistency | 653 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
654 | * problems on Alpha CPUs. | 654 | * problems on Alpha CPUs. |
655 | */ | 655 | */ |
656 | static inline void hlist_add_before_rcu(struct hlist_node *n, | 656 | static inline void hlist_add_before_rcu(struct hlist_node *n, |
@@ -675,7 +675,7 @@ static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
675 | * or hlist_del_rcu(), running on this same list. | 675 | * or hlist_del_rcu(), running on this same list. |
676 | * However, it is perfectly legal to run concurrently with | 676 | * However, it is perfectly legal to run concurrently with |
677 | * the _rcu list-traversal primitives, such as | 677 | * the _rcu list-traversal primitives, such as |
678 | * hlist_for_each_rcu(), used to prevent memory-consistency | 678 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
679 | * problems on Alpha CPUs. | 679 | * problems on Alpha CPUs. |
680 | */ | 680 | */ |
681 | static inline void hlist_add_after_rcu(struct hlist_node *prev, | 681 | static inline void hlist_add_after_rcu(struct hlist_node *prev, |
@@ -699,11 +699,6 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
699 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ | 699 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ |
700 | pos = n) | 700 | pos = n) |
701 | 701 | ||
702 | #define hlist_for_each_rcu(pos, head) \ | ||
703 | for ((pos) = (head)->first; \ | ||
704 | rcu_dereference((pos)) && ({ prefetch((pos)->next); 1; }); \ | ||
705 | (pos) = (pos)->next) | ||
706 | |||
707 | /** | 702 | /** |
708 | * hlist_for_each_entry - iterate over list of given type | 703 | * hlist_for_each_entry - iterate over list of given type |
709 | * @tpos: the type * to use as a loop counter. | 704 | * @tpos: the type * to use as a loop counter. |
@@ -756,7 +751,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
756 | 751 | ||
757 | /** | 752 | /** |
758 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 753 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
759 | * @pos: the type * to use as a loop counter. | 754 | * @tpos: the type * to use as a loop counter. |
760 | * @pos: the &struct hlist_node to use as a loop counter. | 755 | * @pos: the &struct hlist_node to use as a loop counter. |
761 | * @head: the head for your list. | 756 | * @head: the head for your list. |
762 | * @member: the name of the hlist_node within the struct. | 757 | * @member: the name of the hlist_node within the struct. |