Commit 16572a48 authored by David S. Miller's avatar David S. Miller

Merge branch 'l2tp-trivial-cleanups'

Guillaume Nault says:

====================
l2tp: trivial cleanups

Just a set of unrelated trivial cleanups (remove unused code, make
local functions static, etc.).
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1d7229dd 2685fbb8
...@@ -322,8 +322,7 @@ int l2tp_session_register(struct l2tp_session *session, ...@@ -322,8 +322,7 @@ int l2tp_session_register(struct l2tp_session *session,
if (tunnel->version == L2TP_HDR_VER_3) { if (tunnel->version == L2TP_HDR_VER_3) {
pn = l2tp_pernet(tunnel->l2tp_net); pn = l2tp_pernet(tunnel->l2tp_net);
g_head = l2tp_session_id_hash_2(l2tp_pernet(tunnel->l2tp_net), g_head = l2tp_session_id_hash_2(pn, session->session_id);
session->session_id);
spin_lock_bh(&pn->l2tp_session_hlist_lock); spin_lock_bh(&pn->l2tp_session_hlist_lock);
...@@ -783,7 +782,7 @@ EXPORT_SYMBOL(l2tp_recv_common); ...@@ -783,7 +782,7 @@ EXPORT_SYMBOL(l2tp_recv_common);
/* Drop skbs from the session's reorder_q /* Drop skbs from the session's reorder_q
*/ */
int l2tp_session_queue_purge(struct l2tp_session *session) static int l2tp_session_queue_purge(struct l2tp_session *session)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
BUG_ON(!session); BUG_ON(!session);
...@@ -794,7 +793,6 @@ int l2tp_session_queue_purge(struct l2tp_session *session) ...@@ -794,7 +793,6 @@ int l2tp_session_queue_purge(struct l2tp_session *session)
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(l2tp_session_queue_purge);
/* Internal UDP receive frame. Do the real work of receiving an L2TP data frame /* Internal UDP receive frame. Do the real work of receiving an L2TP data frame
* here. The skb is not on a list when we get here. * here. The skb is not on a list when we get here.
...@@ -1009,7 +1007,7 @@ static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf) ...@@ -1009,7 +1007,7 @@ static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf)
return bufp - optr; return bufp - optr;
} }
static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, static void l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
struct flowi *fl, size_t data_len) struct flowi *fl, size_t data_len)
{ {
struct l2tp_tunnel *tunnel = session->tunnel; struct l2tp_tunnel *tunnel = session->tunnel;
...@@ -1052,8 +1050,6 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, ...@@ -1052,8 +1050,6 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
atomic_long_inc(&tunnel->stats.tx_errors); atomic_long_inc(&tunnel->stats.tx_errors);
atomic_long_inc(&session->stats.tx_errors); atomic_long_inc(&session->stats.tx_errors);
} }
return 0;
} }
/* If caller requires the skb to have a ppp header, the header must be /* If caller requires the skb to have a ppp header, the header must be
...@@ -1193,7 +1189,7 @@ static void l2tp_tunnel_destruct(struct sock *sk) ...@@ -1193,7 +1189,7 @@ static void l2tp_tunnel_destruct(struct sock *sk)
/* When the tunnel is closed, all the attached sessions need to go too. /* When the tunnel is closed, all the attached sessions need to go too.
*/ */
void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel)
{ {
int hash; int hash;
struct hlist_node *walk; struct hlist_node *walk;
...@@ -1242,7 +1238,6 @@ void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) ...@@ -1242,7 +1238,6 @@ void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel)
} }
write_unlock_bh(&tunnel->hlist_lock); write_unlock_bh(&tunnel->hlist_lock);
} }
EXPORT_SYMBOL_GPL(l2tp_tunnel_closeall);
/* Tunnel socket destroy hook for UDP encapsulation */ /* Tunnel socket destroy hook for UDP encapsulation */
static void l2tp_udp_encap_destroy(struct sock *sk) static void l2tp_udp_encap_destroy(struct sock *sk)
......
...@@ -180,9 +180,6 @@ struct l2tp_tunnel { ...@@ -180,9 +180,6 @@ struct l2tp_tunnel {
struct net *l2tp_net; /* the net we belong to */ struct net *l2tp_net; /* the net we belong to */
refcount_t ref_count; refcount_t ref_count;
#ifdef CONFIG_DEBUG_FS
void (*show)(struct seq_file *m, void *arg);
#endif
int (*recv_payload_hook)(struct sk_buff *skb); int (*recv_payload_hook)(struct sk_buff *skb);
void (*old_sk_destruct)(struct sock *); void (*old_sk_destruct)(struct sock *);
struct sock *sock; /* Parent socket */ struct sock *sock; /* Parent socket */
...@@ -190,8 +187,6 @@ struct l2tp_tunnel { ...@@ -190,8 +187,6 @@ struct l2tp_tunnel {
* was created by userspace */ * was created by userspace */
struct work_struct del_work; struct work_struct del_work;
uint8_t priv[0]; /* private data */
}; };
struct l2tp_nl_cmd_ops { struct l2tp_nl_cmd_ops {
...@@ -201,11 +196,6 @@ struct l2tp_nl_cmd_ops { ...@@ -201,11 +196,6 @@ struct l2tp_nl_cmd_ops {
int (*session_delete)(struct l2tp_session *session); int (*session_delete)(struct l2tp_session *session);
}; };
static inline void *l2tp_tunnel_priv(struct l2tp_tunnel *tunnel)
{
return &tunnel->priv[0];
}
static inline void *l2tp_session_priv(struct l2tp_session *session) static inline void *l2tp_session_priv(struct l2tp_session *session)
{ {
return &session->priv[0]; return &session->priv[0];
...@@ -229,7 +219,6 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, ...@@ -229,7 +219,6 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id,
int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net, int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net,
struct l2tp_tunnel_cfg *cfg); struct l2tp_tunnel_cfg *cfg);
void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel);
void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel); void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel);
struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_session *l2tp_session_create(int priv_size,
struct l2tp_tunnel *tunnel, struct l2tp_tunnel *tunnel,
...@@ -244,7 +233,6 @@ void l2tp_session_free(struct l2tp_session *session); ...@@ -244,7 +233,6 @@ void l2tp_session_free(struct l2tp_session *session);
void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb, void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
unsigned char *ptr, unsigned char *optr, u16 hdrflags, unsigned char *ptr, unsigned char *optr, u16 hdrflags,
int length, int (*payload_hook)(struct sk_buff *skb)); int length, int (*payload_hook)(struct sk_buff *skb));
int l2tp_session_queue_purge(struct l2tp_session *session);
int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb); int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb);
void l2tp_session_set_header_len(struct l2tp_session *session, int version); void l2tp_session_set_header_len(struct l2tp_session *session, int version);
......
...@@ -177,9 +177,6 @@ static void l2tp_dfs_seq_tunnel_show(struct seq_file *m, void *v) ...@@ -177,9 +177,6 @@ static void l2tp_dfs_seq_tunnel_show(struct seq_file *m, void *v)
atomic_long_read(&tunnel->stats.rx_packets), atomic_long_read(&tunnel->stats.rx_packets),
atomic_long_read(&tunnel->stats.rx_bytes), atomic_long_read(&tunnel->stats.rx_bytes),
atomic_long_read(&tunnel->stats.rx_errors)); atomic_long_read(&tunnel->stats.rx_errors));
if (tunnel->show != NULL)
tunnel->show(m, tunnel);
} }
static void l2tp_dfs_seq_session_show(struct seq_file *m, void *v) static void l2tp_dfs_seq_session_show(struct seq_file *m, void *v)
......
...@@ -424,12 +424,6 @@ static void pppol2tp_put_sk(struct rcu_head *head) ...@@ -424,12 +424,6 @@ static void pppol2tp_put_sk(struct rcu_head *head)
sock_put(ps->__sk); sock_put(ps->__sk);
} }
/* Called by l2tp_core when a session socket is being closed.
*/
static void pppol2tp_session_close(struct l2tp_session *session)
{
}
/* Really kill the session socket. (Called from sock_put() if /* Really kill the session socket. (Called from sock_put() if
* refcnt == 0.) * refcnt == 0.)
*/ */
...@@ -573,7 +567,6 @@ static void pppol2tp_session_init(struct l2tp_session *session) ...@@ -573,7 +567,6 @@ static void pppol2tp_session_init(struct l2tp_session *session)
struct dst_entry *dst; struct dst_entry *dst;
session->recv_skb = pppol2tp_recv; session->recv_skb = pppol2tp_recv;
session->session_close = pppol2tp_session_close;
#if IS_ENABLED(CONFIG_L2TP_DEBUGFS) #if IS_ENABLED(CONFIG_L2TP_DEBUGFS)
session->show = pppol2tp_show; session->show = pppol2tp_show;
#endif #endif
......
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