The following commit has been merged in the master branch: commit ec619d0f3b6438bbbcc8aeb5a9c0899f6cc491fb Merge: 3a0a234222758b84d99e7f62d5d466a06128ffcb 81f834b4f278b8f1a79ea412f142ef45d63ab7ca Author: Marek Lindner lindner_marek@yahoo.de Date: Mon Oct 17 14:02:22 2011 +0200
Merge branch 'next'
diff --combined translation-table.c index 2d2cfc1,04ad2a4..d4a3917 --- a/translation-table.c +++ b/translation-table.c @@@ -67,7 -67,7 +67,7 @@@ static struct tt_local_entry *tt_local_ struct hlist_head *head; struct hlist_node *node; struct tt_local_entry *tt_local_entry, *tt_local_entry_tmp = NULL; - int index; + uint32_t index;
if (!hash) return NULL; @@@ -99,7 -99,7 +99,7 @@@ static struct tt_global_entry *tt_globa struct hlist_node *node; struct tt_global_entry *tt_global_entry; struct tt_global_entry *tt_global_entry_tmp = NULL; - int index; + uint32_t index;
if (!hash) return NULL; @@@ -304,8 -304,7 +304,8 @@@ int tt_local_seq_print_text(struct seq_ struct hlist_head *head; size_t buf_size, pos; char *buff; - int i, ret = 0; + uint32_t i; + int ret = 0;
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { @@@ -416,7 -415,7 +416,7 @@@ static void tt_local_purge(struct bat_p struct hlist_node *node, *node_tmp; struct hlist_head *head; spinlock_t *list_lock; /* protects write access to the hash lists */ - int i; + uint32_t i;
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -454,7 -453,7 +454,7 @@@ static void tt_local_table_free(struct struct tt_local_entry *tt_local_entry; struct hlist_node *node, *node_tmp; struct hlist_head *head; - int i; + uint32_t i;
if (!bat_priv->tt_local_hash) return; @@@ -581,8 -580,7 +581,8 @@@ int tt_global_seq_print_text(struct seq struct hlist_head *head; size_t buf_size, pos; char *buff; - int i, ret = 0; + uint32_t i; + int ret = 0;
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { @@@ -706,7 -704,7 +706,7 @@@ void tt_global_del_orig(struct bat_pri struct orig_node *orig_node, const char *message) { struct tt_global_entry *tt_global_entry; - int i; + uint32_t i; struct hashtable_t *hash = bat_priv->tt_global_hash; struct hlist_node *node, *safe; struct hlist_head *head; @@@ -722,10 -720,9 +722,10 @@@ if (tt_global_entry->orig_node == orig_node) { bat_dbg(DBG_TT, bat_priv, "Deleting global tt entry %pM " - "(via %pM): originator time out\n", + "(via %pM): %s\n", tt_global_entry->addr, - tt_global_entry->orig_node->orig); + tt_global_entry->orig_node->orig, + message); hlist_del_rcu(node); tt_global_entry_free_ref(tt_global_entry); } @@@ -742,7 -739,7 +742,7 @@@ static void tt_global_roam_purge(struc struct hlist_node *node, *node_tmp; struct hlist_head *head; spinlock_t *list_lock; /* protects write access to the hash lists */ - int i; + uint32_t i;
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -776,7 -773,7 +776,7 @@@ static void tt_global_table_free(struc struct tt_global_entry *tt_global_entry; struct hlist_node *node, *node_tmp; struct hlist_head *head; - int i; + uint32_t i;
if (!bat_priv->tt_global_hash) return; @@@ -862,8 -859,7 +862,8 @@@ uint16_t tt_global_crc(struct bat_priv struct tt_global_entry *tt_global_entry; struct hlist_node *node; struct hlist_head *head; - int i, j; + uint32_t i; + int j;
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -900,8 -896,7 +900,8 @@@ uint16_t tt_local_crc(struct bat_priv * struct tt_local_entry *tt_local_entry; struct hlist_node *node; struct hlist_head *head; - int i, j; + uint32_t i; + int j;
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -1038,7 -1033,7 +1038,7 @@@ static struct sk_buff *tt_response_fill struct sk_buff *skb = NULL; uint16_t tt_tot, tt_count; ssize_t tt_query_size = sizeof(struct tt_query_packet); - int i; + uint32_t i;
if (tt_query_size + tt_len > primary_if->soft_iface->mtu) { tt_len = primary_if->soft_iface->mtu - tt_query_size; @@@ -1174,11 -1169,11 +1174,11 @@@ static bool send_other_tt_response(stru (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
/* Let's get the orig node of the REAL destination */ - req_dst_orig_node = get_orig_node(bat_priv, tt_request->dst); + req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst); if (!req_dst_orig_node) goto out;
- res_dst_orig_node = get_orig_node(bat_priv, tt_request->src); + res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src); if (!res_dst_orig_node) goto out;
@@@ -1304,7 -1299,7 +1304,7 @@@ static bool send_my_tt_response(struct my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn); req_ttvn = tt_request->ttvn;
- orig_node = get_orig_node(bat_priv, tt_request->src); + orig_node = orig_hash_find(bat_priv, tt_request->src); if (!orig_node) goto out;
@@@ -1712,7 -1707,7 +1712,7 @@@ void tt_free(struct bat_priv *bat_priv * entry */ static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags) { - int i; + uint32_t i; struct hashtable_t *hash = bat_priv->tt_local_hash; struct hlist_head *head; struct hlist_node *node; @@@ -1727,6 -1722,8 +1727,8 @@@ rcu_read_lock(); hlist_for_each_entry_rcu(tt_local_entry, node, head, hash_entry) { + if (!(tt_local_entry->flags & flags)) + continue; tt_local_entry->flags &= ~flags; atomic_inc(&bat_priv->num_local_tt); } @@@ -1743,7 -1740,7 +1745,7 @@@ static void tt_local_purge_pending_clie struct hlist_node *node, *node_tmp; struct hlist_head *head; spinlock_t *list_lock; /* protects write access to the hash lists */ - int i; + uint32_t i;
if (!hash) return;