The following commit has been merged in the master branch:
commit ae179ae433bb4ef6b6179c5c1c7b6cc7dc01c670
Author: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Date: Sun May 1 23:27:50 2011 -0700
batman,rcu: convert call_rcu(neigh_node_free_rcu) to kfree()
The RCU callback neigh_node_free_rcu() just calls kfree(), so we can use
kfree_rcu() instead of call_rcu().
Signed-off-by: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Cc: Marek Lindner <lindner_marek(a)yahoo.de>
Cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Acked-by: David S. Miller <davem(a)davemloft.net>
Reviewed-by: Josh Triplett <josh(a)joshtriplett.org>
Acked-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 0b91330..ed23a589 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -56,18 +56,10 @@ err:
return 0;
}
-static void neigh_node_free_rcu(struct rcu_head *rcu)
-{
- struct neigh_node *neigh_node;
-
- neigh_node = container_of(rcu, struct neigh_node, rcu);
- kfree(neigh_node);
-}
-
void neigh_node_free_ref(struct neigh_node *neigh_node)
{
if (atomic_dec_and_test(&neigh_node->refcount))
- call_rcu(&neigh_node->rcu, neigh_node_free_rcu);
+ kfree_rcu(neigh_node, rcu);
}
struct neigh_node *create_neighbor(struct orig_node *orig_node,
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit eb340b2f804860a51a0b92e35fd36742b6c2d6b7
Author: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Date: Sun May 1 23:25:02 2011 -0700
batman,rcu: convert call_rcu(gw_node_free_rcu) to kfree_rcu
The RCU callback gw_node_free_rcu() just calls kfree(), so we can use
kfree_rcu() instead of call_rcu().
Signed-off-by: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Cc: Marek Lindner <lindner_marek(a)yahoo.de>
Cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Acked-by: David S. Miller <davem(a)davemloft.net>
Reviewed-by: Josh Triplett <josh(a)joshtriplett.org>
Acked-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 3cc4355..150b6ce 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -28,18 +28,10 @@
#include <linux/udp.h>
#include <linux/if_vlan.h>
-static void gw_node_free_rcu(struct rcu_head *rcu)
-{
- struct gw_node *gw_node;
-
- gw_node = container_of(rcu, struct gw_node, rcu);
- kfree(gw_node);
-}
-
static void gw_node_free_ref(struct gw_node *gw_node)
{
if (atomic_dec_and_test(&gw_node->refcount))
- call_rcu(&gw_node->rcu, gw_node_free_rcu);
+ kfree_rcu(gw_node, rcu);
}
void *gw_get_selected(struct bat_priv *bat_priv)
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit 28f8e546e6bc4c2bc6687d7c8dcbe9934cebe639
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon May 2 16:37:13 2011 +0200
batman-adv: remove misplaced comment
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index ef4a9be..51af91b 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -19,8 +19,6 @@
*
*/
-/* increase the reference counter for this originator */
-
#include "main.h"
#include "originator.h"
#include "hash.h"
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit 8e3572cff70ee19a0a1f2e2dde0bca0b7c8b54dc
Author: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Date: Mon May 2 00:52:23 2011 -0700
batman,rcu: convert call_rcu(softif_neigh_free_rcu) to kfree_rcu
The RCU callback softif_neigh_free_rcu() just calls kfree(), so we can
use kfree_rcu() instead of call_rcu().
Signed-off-by: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Cc: Marek Lindner <lindner_marek(a)yahoo.de>
Cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Acked-by: David S. Miller <davem(a)davemloft.net>
Reviewed-by: Josh Triplett <josh(a)joshtriplett.org>
Acked-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 824e1f6..04efe02 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -76,18 +76,10 @@ int my_skb_head_push(struct sk_buff *skb, unsigned int len)
return 0;
}
-static void softif_neigh_free_rcu(struct rcu_head *rcu)
-{
- struct softif_neigh *softif_neigh;
-
- softif_neigh = container_of(rcu, struct softif_neigh, rcu);
- kfree(softif_neigh);
-}
-
static void softif_neigh_free_ref(struct softif_neigh *softif_neigh)
{
if (atomic_dec_and_test(&softif_neigh->refcount))
- call_rcu(&softif_neigh->rcu, softif_neigh_free_rcu);
+ kfree_rcu(softif_neigh, rcu);
}
void softif_neigh_purge(struct bat_priv *bat_priv)
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit 71e4aa9c465fd66c110667ab5d620fb6a4ef2157
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Mon Apr 25 22:44:32 2011 +0200
batman-adv: fix gw_node_update() and gw_election()
This is a regression from c4aac1ab9b973798163b34939b522f01e4d28ac9
- gw_node_update() doesn't add a new gw_node in case of empty curr_gw.
This means that at the beginning no gw_node is added, leading to an
empty gateway list.
- gw_election() is terminating in case of curr_gw == NULL. It has to
terminate in case of curr_gw != NULL
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 2acd7a6..af128ef 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -127,7 +127,7 @@ void gw_election(struct bat_priv *bat_priv)
return;
curr_gw = gw_get_selected_gw_node(bat_priv);
- if (!curr_gw)
+ if (curr_gw)
goto out;
rcu_read_lock();
@@ -310,9 +310,13 @@ void gw_node_update(struct bat_priv *bat_priv,
struct hlist_node *node;
struct gw_node *gw_node, *curr_gw;
+ /**
+ * Note: We don't need a NULL check here, since curr_gw never gets
+ * dereferenced. If curr_gw is NULL we also should not exit as we may
+ * have this gateway in our list (duplication check!) even though we
+ * have no currently selected gateway.
+ */
curr_gw = gw_get_selected_gw_node(bat_priv);
- if (!curr_gw)
- goto out;
rcu_read_lock();
hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) {
@@ -350,7 +354,7 @@ deselect:
gw_deselect(bat_priv);
unlock:
rcu_read_unlock();
-out:
+
if (curr_gw)
gw_node_free_ref(curr_gw);
}
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit 5f657ec0d2103571a31707711926b443a27b0c66
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed Apr 20 09:52:56 2011 +0200
batman-adv: Move definition of atomic_dec_not_zero() into main.h
atomic_dec_not_zero() is very useful and it is currently defined
multiple times. So it is possible to move it in main.h
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/net/batman-adv/aggregation.c b/net/batman-adv/aggregation.c
index af45d6b..c11788c 100644
--- a/net/batman-adv/aggregation.c
+++ b/net/batman-adv/aggregation.c
@@ -95,7 +95,6 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
return false;
}
-#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
/* create a new aggregated packet and add this packet to it */
static void new_aggregated_packet(unsigned char *packet_buff, int packet_len,
unsigned long send_time, bool direct_link,
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index dc24869..ace7285 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -175,4 +175,6 @@ static inline int compare_eth(void *data1, void *data2)
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
}
+#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
+
#endif /* _NET_BATMAN_ADV_MAIN_H_ */
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index e78670c..7650e2b 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -393,7 +393,6 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
send_time);
}
-#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
/* add a broadcast packet to the queue and setup timers. broadcast packets
* are sent multiple times to increase probability for beeing received.
*
--
LinuxNextTracking