summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorMarek Lindner <mareklindner@neomailbox.ch>2015-06-18 04:11:07 -0400
committerAntonio Quartulli <antonio@meshcoding.com>2015-08-24 18:12:19 -0400
commit433ff98f3f1d6baa56e23f6b50370a5ab16c0e66 (patch)
treec9e85daf762392184032933c8651a185a1fb3337 /net/batman-adv
parent4f248cff9e21720bd5f057661f752fba067f3779 (diff)
batman-adv: update kernel doc of batadv_tt_global_del_orig_entry()
The updated kernel doc & additional comment shall prevent accidental copy & paste errors or calling the function without the required precautions. Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/translation-table.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7e34901e214c..6b5f718f6705 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -1658,20 +1658,26 @@ out:
1658} 1658}
1659 1659
1660/** 1660/**
1661 * batadv_tt_global_del_orig_entry - remove and free an orig_entry 1661 * _batadv_tt_global_del_orig_entry - remove and free an orig_entry
1662 * @tt_global_entry: the global entry to remove the orig_entry from 1662 * @tt_global_entry: the global entry to remove the orig_entry from
1663 * @orig_entry: the orig entry to remove and free 1663 * @orig_entry: the orig entry to remove and free
1664 * 1664 *
1665 * Remove an orig_entry from its list in the given tt_global_entry and 1665 * Remove an orig_entry from its list in the given tt_global_entry and
1666 * free this orig_entry afterwards. 1666 * free this orig_entry afterwards.
1667 *
1668 * Caller must hold tt_global_entry->list_lock and ensure orig_entry->list is
1669 * part of a list.
1667 */ 1670 */
1668static void 1671static void
1669batadv_tt_global_del_orig_entry(struct batadv_tt_global_entry *tt_global_entry, 1672_batadv_tt_global_del_orig_entry(struct batadv_tt_global_entry *tt_global_entry,
1670 struct batadv_tt_orig_list_entry *orig_entry) 1673 struct batadv_tt_orig_list_entry *orig_entry)
1671{ 1674{
1672 batadv_tt_global_size_dec(orig_entry->orig_node, 1675 batadv_tt_global_size_dec(orig_entry->orig_node,
1673 tt_global_entry->common.vid); 1676 tt_global_entry->common.vid);
1674 atomic_dec(&tt_global_entry->orig_list_count); 1677 atomic_dec(&tt_global_entry->orig_list_count);
1678 /* requires holding tt_global_entry->list_lock and orig_entry->list
1679 * being part of a list
1680 */
1675 hlist_del_rcu(&orig_entry->list); 1681 hlist_del_rcu(&orig_entry->list);
1676 batadv_tt_orig_list_entry_free_ref(orig_entry); 1682 batadv_tt_orig_list_entry_free_ref(orig_entry);
1677} 1683}
@@ -1687,7 +1693,7 @@ batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry)
1687 spin_lock_bh(&tt_global_entry->list_lock); 1693 spin_lock_bh(&tt_global_entry->list_lock);
1688 head = &tt_global_entry->orig_list; 1694 head = &tt_global_entry->orig_list;
1689 hlist_for_each_entry_safe(orig_entry, safe, head, list) 1695 hlist_for_each_entry_safe(orig_entry, safe, head, list)
1690 batadv_tt_global_del_orig_entry(tt_global_entry, orig_entry); 1696 _batadv_tt_global_del_orig_entry(tt_global_entry, orig_entry);
1691 spin_unlock_bh(&tt_global_entry->list_lock); 1697 spin_unlock_bh(&tt_global_entry->list_lock);
1692} 1698}
1693 1699
@@ -1722,8 +1728,8 @@ batadv_tt_global_del_orig_node(struct batadv_priv *bat_priv,
1722 orig_node->orig, 1728 orig_node->orig,
1723 tt_global_entry->common.addr, 1729 tt_global_entry->common.addr,
1724 BATADV_PRINT_VID(vid), message); 1730 BATADV_PRINT_VID(vid), message);
1725 batadv_tt_global_del_orig_entry(tt_global_entry, 1731 _batadv_tt_global_del_orig_entry(tt_global_entry,
1726 orig_entry); 1732 orig_entry);
1727 } 1733 }
1728 } 1734 }
1729 spin_unlock_bh(&tt_global_entry->list_lock); 1735 spin_unlock_bh(&tt_global_entry->list_lock);