diff options
author | Ken Helias <kenhelias@firemail.de> | 2014-08-06 19:09:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:24 -0400 |
commit | 1d023284c31a4e40a94d5bbcb7dbb7a35ee0bcbc (patch) | |
tree | 24b0b38fbd227873f771ebca55cba8b595bb6c57 | |
parent | bc18dd335a161f9229ed3aaab88ce0706cbd9867 (diff) |
list: fix order of arguments for hlist_add_after(_rcu)
All other add functions for lists have the new item as first argument
and the position where it is added as second argument. This was changed
for no good reason in this function and makes using it unnecessary
confusing.
The name was changed to hlist_add_behind() to cause unconverted code to
generate a compile error instead of using the wrong parameter order.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Ken Helias <kenhelias@firemail.de>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> [intel driver bits]
Cc: Hugh Dickins <hughd@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/RCU/whatisRCU.txt | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_hashtab.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/hash.c | 4 | ||||
-rw-r--r-- | fs/namespace.c | 2 | ||||
-rw-r--r-- | fs/notify/inode_mark.c | 2 | ||||
-rw-r--r-- | fs/notify/vfsmount_mark.c | 2 | ||||
-rw-r--r-- | include/linux/list.h | 4 | ||||
-rw-r--r-- | include/linux/rculist.h | 8 | ||||
-rw-r--r-- | net/batman-adv/fragmentation.c | 2 | ||||
-rw-r--r-- | net/bridge/br_multicast.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 2 | ||||
-rw-r--r-- | net/ipv6/addrlabel.c | 2 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 4 |
15 files changed, 21 insertions, 21 deletions
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 49b8551a3b68..e48c57f1943b 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -818,7 +818,7 @@ RCU pointer/list update: | |||
818 | list_add_tail_rcu | 818 | list_add_tail_rcu |
819 | list_del_rcu | 819 | list_del_rcu |
820 | list_replace_rcu | 820 | list_replace_rcu |
821 | hlist_add_after_rcu | 821 | hlist_add_behind_rcu |
822 | hlist_add_before_rcu | 822 | hlist_add_before_rcu |
823 | hlist_add_head_rcu | 823 | hlist_add_head_rcu |
824 | hlist_del_rcu | 824 | hlist_del_rcu |
diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c index 7e4bae760e27..c3b80fd65d62 100644 --- a/drivers/gpu/drm/drm_hashtab.c +++ b/drivers/gpu/drm/drm_hashtab.c | |||
@@ -125,7 +125,7 @@ int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item) | |||
125 | parent = &entry->head; | 125 | parent = &entry->head; |
126 | } | 126 | } |
127 | if (parent) { | 127 | if (parent) { |
128 | hlist_add_after_rcu(parent, &item->head); | 128 | hlist_add_behind_rcu(&item->head, parent); |
129 | } else { | 129 | } else { |
130 | hlist_add_head_rcu(&item->head, h_list); | 130 | hlist_add_head_rcu(&item->head, h_list); |
131 | } | 131 | } |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 681a9e81ff51..e8ba7470700a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |||
@@ -1948,7 +1948,7 @@ static int i40e_update_ethtool_fdir_entry(struct i40e_vsi *vsi, | |||
1948 | 1948 | ||
1949 | /* add filter to the list */ | 1949 | /* add filter to the list */ |
1950 | if (parent) | 1950 | if (parent) |
1951 | hlist_add_after(&parent->fdir_node, &input->fdir_node); | 1951 | hlist_add_behind(&input->fdir_node, &parent->fdir_node); |
1952 | else | 1952 | else |
1953 | hlist_add_head(&input->fdir_node, | 1953 | hlist_add_head(&input->fdir_node, |
1954 | &pf->fdir_filter_list); | 1954 | &pf->fdir_filter_list); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 94a1c07efeb0..e4100b5737b6 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -2517,7 +2517,7 @@ static int ixgbe_update_ethtool_fdir_entry(struct ixgbe_adapter *adapter, | |||
2517 | 2517 | ||
2518 | /* add filter to the list */ | 2518 | /* add filter to the list */ |
2519 | if (parent) | 2519 | if (parent) |
2520 | hlist_add_after(&parent->fdir_node, &input->fdir_node); | 2520 | hlist_add_behind(&input->fdir_node, &parent->fdir_node); |
2521 | else | 2521 | else |
2522 | hlist_add_head(&input->fdir_node, | 2522 | hlist_add_head(&input->fdir_node, |
2523 | &adapter->fdir_filter_list); | 2523 | &adapter->fdir_filter_list); |
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 5dde79418297..8ef1deb59d4a 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c | |||
@@ -351,7 +351,7 @@ cfs_hash_dh_hnode_add(struct cfs_hash *hs, struct cfs_hash_bd *bd, | |||
351 | cfs_hash_dhead_t, dh_head); | 351 | cfs_hash_dhead_t, dh_head); |
352 | 352 | ||
353 | if (dh->dh_tail != NULL) /* not empty */ | 353 | if (dh->dh_tail != NULL) /* not empty */ |
354 | hlist_add_after(dh->dh_tail, hnode); | 354 | hlist_add_behind(hnode, dh->dh_tail); |
355 | else /* empty list */ | 355 | else /* empty list */ |
356 | hlist_add_head(hnode, &dh->dh_head); | 356 | hlist_add_head(hnode, &dh->dh_head); |
357 | dh->dh_tail = hnode; | 357 | dh->dh_tail = hnode; |
@@ -406,7 +406,7 @@ cfs_hash_dd_hnode_add(struct cfs_hash *hs, struct cfs_hash_bd *bd, | |||
406 | cfs_hash_dhead_dep_t, dd_head); | 406 | cfs_hash_dhead_dep_t, dd_head); |
407 | 407 | ||
408 | if (dh->dd_tail != NULL) /* not empty */ | 408 | if (dh->dd_tail != NULL) /* not empty */ |
409 | hlist_add_after(dh->dd_tail, hnode); | 409 | hlist_add_behind(hnode, dh->dd_tail); |
410 | else /* empty list */ | 410 | else /* empty list */ |
411 | hlist_add_head(hnode, &dh->dd_head); | 411 | hlist_add_head(hnode, &dh->dd_head); |
412 | dh->dd_tail = hnode; | 412 | dh->dd_tail = hnode; |
diff --git a/fs/namespace.c b/fs/namespace.c index 182bc41cd887..2a1447c946e7 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -798,7 +798,7 @@ static void commit_tree(struct mount *mnt, struct mount *shadows) | |||
798 | list_splice(&head, n->list.prev); | 798 | list_splice(&head, n->list.prev); |
799 | 799 | ||
800 | if (shadows) | 800 | if (shadows) |
801 | hlist_add_after_rcu(&shadows->mnt_hash, &mnt->mnt_hash); | 801 | hlist_add_behind_rcu(&mnt->mnt_hash, &shadows->mnt_hash); |
802 | else | 802 | else |
803 | hlist_add_head_rcu(&mnt->mnt_hash, | 803 | hlist_add_head_rcu(&mnt->mnt_hash, |
804 | m_hash(&parent->mnt, mnt->mnt_mountpoint)); | 804 | m_hash(&parent->mnt, mnt->mnt_mountpoint)); |
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index 74825be65b7b..9ce062218de9 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
@@ -232,7 +232,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, | |||
232 | 232 | ||
233 | BUG_ON(last == NULL); | 233 | BUG_ON(last == NULL); |
234 | /* mark should be the last entry. last is the current last entry */ | 234 | /* mark should be the last entry. last is the current last entry */ |
235 | hlist_add_after_rcu(&last->i.i_list, &mark->i.i_list); | 235 | hlist_add_behind_rcu(&mark->i.i_list, &last->i.i_list); |
236 | out: | 236 | out: |
237 | fsnotify_recalc_inode_mask_locked(inode); | 237 | fsnotify_recalc_inode_mask_locked(inode); |
238 | spin_unlock(&inode->i_lock); | 238 | spin_unlock(&inode->i_lock); |
diff --git a/fs/notify/vfsmount_mark.c b/fs/notify/vfsmount_mark.c index 68ca5a8704b5..ac851e8376b1 100644 --- a/fs/notify/vfsmount_mark.c +++ b/fs/notify/vfsmount_mark.c | |||
@@ -191,7 +191,7 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark, | |||
191 | 191 | ||
192 | BUG_ON(last == NULL); | 192 | BUG_ON(last == NULL); |
193 | /* mark should be the last entry. last is the current last entry */ | 193 | /* mark should be the last entry. last is the current last entry */ |
194 | hlist_add_after_rcu(&last->m.m_list, &mark->m.m_list); | 194 | hlist_add_behind_rcu(&mark->m.m_list, &last->m.m_list); |
195 | out: | 195 | out: |
196 | fsnotify_recalc_vfsmount_mask_locked(mnt); | 196 | fsnotify_recalc_vfsmount_mask_locked(mnt); |
197 | spin_unlock(&mnt->mnt_root->d_lock); | 197 | spin_unlock(&mnt->mnt_root->d_lock); |
diff --git a/include/linux/list.h b/include/linux/list.h index 624ec7f48293..cbbb96fcead9 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -654,8 +654,8 @@ static inline void hlist_add_before(struct hlist_node *n, | |||
654 | *(n->pprev) = n; | 654 | *(n->pprev) = n; |
655 | } | 655 | } |
656 | 656 | ||
657 | static inline void hlist_add_after(struct hlist_node *prev, | 657 | static inline void hlist_add_behind(struct hlist_node *n, |
658 | struct hlist_node *n) | 658 | struct hlist_node *prev) |
659 | { | 659 | { |
660 | n->next = prev->next; | 660 | n->next = prev->next; |
661 | prev->next = n; | 661 | prev->next = n; |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 8183b46fbaa2..372ad5e0dcb8 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -432,9 +432,9 @@ static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
432 | } | 432 | } |
433 | 433 | ||
434 | /** | 434 | /** |
435 | * hlist_add_after_rcu | 435 | * hlist_add_behind_rcu |
436 | * @prev: the existing element to add the new element after. | ||
437 | * @n: the new element to add to the hash list. | 436 | * @n: the new element to add to the hash list. |
437 | * @prev: the existing element to add the new element after. | ||
438 | * | 438 | * |
439 | * Description: | 439 | * Description: |
440 | * Adds the specified element to the specified hlist | 440 | * Adds the specified element to the specified hlist |
@@ -449,8 +449,8 @@ static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
449 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency | 449 | * hlist_for_each_entry_rcu(), used to prevent memory-consistency |
450 | * problems on Alpha CPUs. | 450 | * problems on Alpha CPUs. |
451 | */ | 451 | */ |
452 | static inline void hlist_add_after_rcu(struct hlist_node *prev, | 452 | static inline void hlist_add_behind_rcu(struct hlist_node *n, |
453 | struct hlist_node *n) | 453 | struct hlist_node *prev) |
454 | { | 454 | { |
455 | n->next = prev->next; | 455 | n->next = prev->next; |
456 | n->pprev = &prev->next; | 456 | n->pprev = &prev->next; |
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index 022d18ab27a6..52c43f904220 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c | |||
@@ -188,7 +188,7 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node, | |||
188 | 188 | ||
189 | /* Reached the end of the list, so insert after 'frag_entry_last'. */ | 189 | /* Reached the end of the list, so insert after 'frag_entry_last'. */ |
190 | if (likely(frag_entry_last)) { | 190 | if (likely(frag_entry_last)) { |
191 | hlist_add_after(&frag_entry_last->list, &frag_entry_new->list); | 191 | hlist_add_behind(&frag_entry_last->list, &frag_entry_new->list); |
192 | chain->size += skb->len - hdr_size; | 192 | chain->size += skb->len - hdr_size; |
193 | chain->timestamp = jiffies; | 193 | chain->timestamp = jiffies; |
194 | ret = true; | 194 | ret = true; |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index b4845f4b2bb4..7751c92c8c57 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -1174,7 +1174,7 @@ static void br_multicast_add_router(struct net_bridge *br, | |||
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | if (slot) | 1176 | if (slot) |
1177 | hlist_add_after_rcu(slot, &port->rlist); | 1177 | hlist_add_behind_rcu(&port->rlist, slot); |
1178 | else | 1178 | else |
1179 | hlist_add_head_rcu(&port->rlist, &br->router_list); | 1179 | hlist_add_head_rcu(&port->rlist, &br->router_list); |
1180 | } | 1180 | } |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 5afeb5aa4c7c..e9cb2588e416 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -940,7 +940,7 @@ static void insert_leaf_info(struct hlist_head *head, struct leaf_info *new) | |||
940 | last = li; | 940 | last = li; |
941 | } | 941 | } |
942 | if (last) | 942 | if (last) |
943 | hlist_add_after_rcu(&last->hlist, &new->hlist); | 943 | hlist_add_behind_rcu(&new->hlist, &last->hlist); |
944 | else | 944 | else |
945 | hlist_add_before_rcu(&new->hlist, &li->hlist); | 945 | hlist_add_before_rcu(&new->hlist, &li->hlist); |
946 | } | 946 | } |
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index 731e1e1722d9..fd0dc47f471d 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c | |||
@@ -277,7 +277,7 @@ static int __ip6addrlbl_add(struct ip6addrlbl_entry *newp, int replace) | |||
277 | last = p; | 277 | last = p; |
278 | } | 278 | } |
279 | if (last) | 279 | if (last) |
280 | hlist_add_after_rcu(&last->list, &newp->list); | 280 | hlist_add_behind_rcu(&newp->list, &last->list); |
281 | else | 281 | else |
282 | hlist_add_head_rcu(&newp->list, &ip6addrlbl_table.head); | 282 | hlist_add_head_rcu(&newp->list, &ip6addrlbl_table.head); |
283 | out: | 283 | out: |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 0525d78ba328..beeed602aeb3 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -389,7 +389,7 @@ redo: | |||
389 | if (h != h0) | 389 | if (h != h0) |
390 | continue; | 390 | continue; |
391 | hlist_del(&pol->bydst); | 391 | hlist_del(&pol->bydst); |
392 | hlist_add_after(entry0, &pol->bydst); | 392 | hlist_add_behind(&pol->bydst, entry0); |
393 | } | 393 | } |
394 | entry0 = &pol->bydst; | 394 | entry0 = &pol->bydst; |
395 | } | 395 | } |
@@ -654,7 +654,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) | |||
654 | break; | 654 | break; |
655 | } | 655 | } |
656 | if (newpos) | 656 | if (newpos) |
657 | hlist_add_after(newpos, &policy->bydst); | 657 | hlist_add_behind(&policy->bydst, newpos); |
658 | else | 658 | else |
659 | hlist_add_head(&policy->bydst, chain); | 659 | hlist_add_head(&policy->bydst, chain); |
660 | xfrm_pol_hold(policy); | 660 | xfrm_pol_hold(policy); |