[PATCH] list: Fix order of arguments for hlist_add_after(_rcu)
On Fri, 6 Jun 2014 10:22:51 -0700 "Paul E. McKenney" wrote: > On Fri, Jun 06, 2014 at 03:56:52PM +, David Laight wrote: > > From: Behalf Of Ken Helias > > > 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. > > > > > > Also the naming of the arguments in hlist_add_after was confusing. It was > > > changed to use the same names as hlist_add_after_rcu. > > ... > > > -static inline void hlist_add_after_rcu(struct hlist_node *prev, > > > -struct hlist_node *n) > > > +static inline void hlist_add_after_rcu(struct hlist_node *n, > > > +struct hlist_node *prev) > > > > It is rather a shame that the change doesn't generate a compilation > > error for old source files. > > I am also a bit concerned by this. > yup. hlist_add_behind()?
[PATCH] list: Fix order of arguments for hlist_add_after(_rcu)
From: Behalf Of Ken Helias > 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. > > Also the naming of the arguments in hlist_add_after was confusing. It was > changed to use the same names as hlist_add_after_rcu. ... > -static inline void hlist_add_after_rcu(struct hlist_node *prev, > -struct hlist_node *n) > +static inline void hlist_add_after_rcu(struct hlist_node *n, > +struct hlist_node *prev) It is rather a shame that the change doesn't generate a compilation error for old source files. David
[PATCH] 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. Also the naming of the arguments in hlist_add_after was confusing. It was changed to use the same names as hlist_add_after_rcu. Signed-off-by: Ken Helias Cc: David Airlie Cc: Jeff Kirsher Cc: Jesse Brandeburg Cc: Bruce Allan Cc: Carolyn Wyborny Cc: Don Skidmore Cc: Greg Rose Cc: Alex Duyck Cc: John Ronciak Cc: Mitch Williams Cc: Linux NICS Cc: Alexander Viro Cc: Dipankar Sarma Cc: "Paul E. McKenney" Cc: Marek Lindner Cc: Simon Wunderlich Cc: Antonio Quartulli Cc: "David S. Miller" Cc: Stephen Hemminger Cc: Alexey Kuznetsov Cc: James Morris Cc: Hideaki YOSHIFUJI Cc: Patrick McHardy Cc: Steffen Klassert Cc: Herbert Xu Cc: dri-devel at lists.freedesktop.org Cc: e1000-devel at lists.sourceforge.net Cc: netdev at vger.kernel.org Cc: devel at driverdev.osuosl.org Cc: linux-fsdevel at vger.kernel.org Cc: b.a.t.m.a.n at lists.open-mesh.org Cc: bridge at lists.linux-foundation.org --- Patch based on "Add linux-next specific files for 20140606" drivers/gpu/drm/drm_hashtab.c| 2 +- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- drivers/staging/lustre/lustre/libcfs/hash.c | 4 ++-- fs/namespace.c | 2 +- fs/notify/inode_mark.c | 2 +- fs/notify/vfsmount_mark.c| 2 +- include/linux/list.h | 12 ++-- include/linux/rculist.h | 6 +++--- net/batman-adv/fragmentation.c | 2 +- net/bridge/br_multicast.c| 2 +- net/ipv4/fib_trie.c | 2 +- net/ipv6/addrlabel.c | 2 +- net/xfrm/xfrm_policy.c | 4 ++-- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c index 7e4bae7..4077a35 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) parent = &entry->head; } if (parent) { - hlist_add_after_rcu(parent, &item->head); + hlist_add_after_rcu(&item->head, parent); } else { hlist_add_head_rcu(&item->head, h_list); } diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 1bb470b..db0a7e1 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -1437,7 +1437,7 @@ static int i40e_update_ethtool_fdir_entry(struct i40e_vsi *vsi, /* add filter to the list */ if (parent) - hlist_add_after(&parent->fdir_node, &input->fdir_node); + hlist_add_after(&input->fdir_node, &parent->fdir_node); else hlist_add_head(&input->fdir_node, &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 23e4e6a..23f4ff3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -2518,7 +2518,7 @@ static int ixgbe_update_ethtool_fdir_entry(struct ixgbe_adapter *adapter, /* add filter to the list */ if (parent) - hlist_add_after(&parent->fdir_node, &input->fdir_node); + hlist_add_after(&input->fdir_node, &parent->fdir_node); else hlist_add_head(&input->fdir_node, &adapter->fdir_filter_list); diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 6d2b455..35835e5 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, cfs_hash_dhead_t, dh_head); if (dh->dh_tail != NULL) /* not empty */ - hlist_add_after(dh->dh_tail, hnode); + hlist_add_after(hnode, dh->dh_tail); else /* empty list */ hlist_add_head(hnode, &dh->dh_head); dh->dh_tail = hnode; @@ -406,7 +406,7 @@ cfs_hash_dd_hnode_add(struct cfs_hash *hs, struct cfs_hash_bd *bd, cfs_hash_dhead_dep_t, dd_head); if (dh->dd_tail != NULL) /* not empty */ - hlist_add_after(dh->dd_tail, hnode); + hlist_add_after(hnode, dh->dd_tail); else /* empty list */ hlist_add_
[PATCH] list: Fix order of arguments for hlist_add_after(_rcu)
On Fri, Jun 06, 2014 at 03:56:52PM +, David Laight wrote: > From: Behalf Of Ken Helias > > 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. > > > > Also the naming of the arguments in hlist_add_after was confusing. It was > > changed to use the same names as hlist_add_after_rcu. > ... > > -static inline void hlist_add_after_rcu(struct hlist_node *prev, > > - struct hlist_node *n) > > +static inline void hlist_add_after_rcu(struct hlist_node *n, > > + struct hlist_node *prev) > > It is rather a shame that the change doesn't generate a compilation > error for old source files. I am also a bit concerned by this. Thanx, Paul
[PATCH] list: Fix order of arguments for hlist_add_after(_rcu)
On Fri, Jun 06, 2014 at 11:42:23AM +0200, Ken Helias wrote: > 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. > > Also the naming of the arguments in hlist_add_after was confusing. It was > changed to use the same names as hlist_add_after_rcu. > > Signed-off-by: Ken Helias > Cc: David Airlie > Cc: Jeff Kirsher > Cc: Jesse Brandeburg > Cc: Bruce Allan > Cc: Carolyn Wyborny > Cc: Don Skidmore > Cc: Greg Rose > Cc: Alex Duyck > Cc: John Ronciak > Cc: Mitch Williams > Cc: Linux NICS > Cc: Alexander Viro > Cc: Dipankar Sarma > Cc: "Paul E. McKenney" > Cc: Marek Lindner > Cc: Simon Wunderlich > Cc: Antonio Quartulli > Cc: "David S. Miller" > Cc: Stephen Hemminger > Cc: Alexey Kuznetsov > Cc: James Morris > Cc: Hideaki YOSHIFUJI > Cc: Patrick McHardy > Cc: Steffen Klassert > Cc: Herbert Xu > Cc: dri-devel at lists.freedesktop.org > Cc: e1000-devel at lists.sourceforge.net > Cc: netdev at vger.kernel.org > Cc: devel at driverdev.osuosl.org > Cc: linux-fsdevel at vger.kernel.org > Cc: b.a.t.m.a.n at lists.open-mesh.org > Cc: bridge at lists.linux-foundation.org > --- > Patch based on "Add linux-next specific files for 20140606" > > drivers/gpu/drm/drm_hashtab.c| 2 +- > drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- > drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- > drivers/staging/lustre/lustre/libcfs/hash.c | 4 ++-- > fs/namespace.c | 2 +- > fs/notify/inode_mark.c | 2 +- > fs/notify/vfsmount_mark.c| 2 +- > include/linux/list.h | 12 ++-- > include/linux/rculist.h | 6 +++--- > net/batman-adv/fragmentation.c | 2 +- > net/bridge/br_multicast.c| 2 +- > net/ipv4/fib_trie.c | 2 +- > net/ipv6/addrlabel.c | 2 +- > net/xfrm/xfrm_policy.c | 4 ++-- > 14 files changed, 23 insertions(+), 23 deletions(-) drivers/staging/ portion: Acked-by: Greg Kroah-Hartman