diff options
author | Florian Westphal <fw@strlen.de> | 2018-12-28 01:24:46 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-12-29 02:45:20 +0100 |
commit | df4a902509766897f7371fdfa4c3bf8bc321b55d (patch) | |
tree | d1c36526cc52fceae52d46a0eb5b5a3c7ffbf2de /drivers/ptp | |
parent | e8cfb372b38a1b8979aa7f7631fb5e7b11c3793c (diff) | |
download | linux-df4a902509766897f7371fdfa4c3bf8bc321b55d.tar.gz linux-df4a902509766897f7371fdfa4c3bf8bc321b55d.tar.bz2 linux-df4a902509766897f7371fdfa4c3bf8bc321b55d.zip |
netfilter: nf_conncount: merge lookup and add functions
'lookup' is always followed by 'add'.
Merge both and make the list-walk part of nf_conncount_add().
This also avoids one unneeded unlock/re-lock pair.
Extra care needs to be taken in count_tree, as we only hold rcu
read lock, i.e. we can only insert to an existing tree node after
acquiring its lock and making sure it has a nonzero count.
As a zero count should be rare, just fall back to insert_tree()
(which acquires tree lock).
This issue and its solution were pointed out by Shawn Bohrer
during patch review.
Reviewed-by: Shawn Bohrer <sbohrer@cloudflare.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'drivers/ptp')
0 files changed, 0 insertions, 0 deletions