Commit c7fa745d authored by Guillaume Nault's avatar Guillaume Nault Committed by David S. Miller

l2tp: remove l2tp_tunnel_count and l2tp_session_count

These variables have never been used.
Signed-off-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ff672ba
...@@ -100,8 +100,6 @@ struct l2tp_skb_cb { ...@@ -100,8 +100,6 @@ struct l2tp_skb_cb {
#define L2TP_SKB_CB(skb) ((struct l2tp_skb_cb *) &skb->cb[sizeof(struct inet_skb_parm)]) #define L2TP_SKB_CB(skb) ((struct l2tp_skb_cb *) &skb->cb[sizeof(struct inet_skb_parm)])
static atomic_t l2tp_tunnel_count;
static atomic_t l2tp_session_count;
static struct workqueue_struct *l2tp_wq; static struct workqueue_struct *l2tp_wq;
/* per-net private data for this module */ /* per-net private data for this module */
...@@ -359,10 +357,6 @@ int l2tp_session_register(struct l2tp_session *session, ...@@ -359,10 +357,6 @@ int l2tp_session_register(struct l2tp_session *session,
hlist_add_head(&session->hlist, head); hlist_add_head(&session->hlist, head);
write_unlock_bh(&tunnel->hlist_lock); write_unlock_bh(&tunnel->hlist_lock);
/* Ignore management session in session count value */
if (session->session_id != 0)
atomic_inc(&l2tp_session_count);
return 0; return 0;
err_tlock_pnlock: err_tlock_pnlock:
...@@ -1251,7 +1245,6 @@ static void l2tp_tunnel_destruct(struct sock *sk) ...@@ -1251,7 +1245,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
spin_lock_bh(&pn->l2tp_tunnel_list_lock); spin_lock_bh(&pn->l2tp_tunnel_list_lock);
list_del_rcu(&tunnel->list); list_del_rcu(&tunnel->list);
spin_unlock_bh(&pn->l2tp_tunnel_list_lock); spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
atomic_dec(&l2tp_tunnel_count);
l2tp_tunnel_closeall(tunnel); l2tp_tunnel_closeall(tunnel);
...@@ -1632,7 +1625,6 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 ...@@ -1632,7 +1625,6 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32
/* Add tunnel to our list */ /* Add tunnel to our list */
INIT_LIST_HEAD(&tunnel->list); INIT_LIST_HEAD(&tunnel->list);
atomic_inc(&l2tp_tunnel_count);
/* Bump the reference count. The tunnel context is deleted /* Bump the reference count. The tunnel context is deleted
* only when this drops to zero. Must be done before list insertion * only when this drops to zero. Must be done before list insertion
...@@ -1678,8 +1670,6 @@ void l2tp_session_free(struct l2tp_session *session) ...@@ -1678,8 +1670,6 @@ void l2tp_session_free(struct l2tp_session *session)
if (tunnel) { if (tunnel) {
BUG_ON(tunnel->magic != L2TP_TUNNEL_MAGIC); BUG_ON(tunnel->magic != L2TP_TUNNEL_MAGIC);
if (session->session_id != 0)
atomic_dec(&l2tp_session_count);
sock_put(tunnel->sock); sock_put(tunnel->sock);
session->tunnel = NULL; session->tunnel = NULL;
l2tp_tunnel_dec_refcount(tunnel); l2tp_tunnel_dec_refcount(tunnel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment