batman-adv: Annotate deleting functions with external lock via lockdep

Functions which use (h)list_del* are requiring correct locking when they
operate on global lists. Most of the time the search in the list and the
delete are done in the same function. All other cases should have it
visible that they require a special lock to avoid race conditions.

Lockdep asserts can be used to check these problem during runtime when the
lockdep functionality is enabled.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
This commit is contained in:
Sven Eckelmann
2015-06-21 14:45:14 +02:00
committed by Antonio Quartulli
parent 7c26a53ba5
commit 2c72d655b0
4 changed files with 25 additions and 5 deletions

View File

@@ -1672,6 +1672,8 @@ static void
_batadv_tt_global_del_orig_entry(struct batadv_tt_global_entry *tt_global_entry,
struct batadv_tt_orig_list_entry *orig_entry)
{
lockdep_assert_held(&tt_global_entry->list_lock);
batadv_tt_global_size_dec(orig_entry->orig_node,
tt_global_entry->common.vid);
atomic_dec(&tt_global_entry->orig_list_count);