Commit 8c6245af authored by James Chapman's avatar James Chapman Committed by David S. Miller
Browse files

l2tp: drop the now unused l2tp_tunnel_get_session



All users of l2tp_tunnel_get_session are now gone so it can be
removed.

Signed-off-by: default avatarJames Chapman <jchapman@katalix.com>
Reviewed-by: default avatarTom Parkin <tparkin@katalix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f77c18e
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -241,28 +241,6 @@ struct l2tp_tunnel *l2tp_tunnel_get_nth(const struct net *net, int nth)
}
EXPORT_SYMBOL_GPL(l2tp_tunnel_get_nth);

struct l2tp_session *l2tp_tunnel_get_session(struct l2tp_tunnel *tunnel,
					     u32 session_id)
{
	struct hlist_head *session_list;
	struct l2tp_session *session;

	session_list = l2tp_session_id_hash(tunnel, session_id);

	rcu_read_lock_bh();
	hlist_for_each_entry_rcu(session, session_list, hlist)
		if (session->session_id == session_id) {
			l2tp_session_inc_refcount(session);
			rcu_read_unlock_bh();

			return session;
		}
	rcu_read_unlock_bh();

	return NULL;
}
EXPORT_SYMBOL_GPL(l2tp_tunnel_get_session);

struct l2tp_session *l2tp_v3_session_get(const struct net *net, struct sock *sk, u32 session_id)
{
	const struct l2tp_net *pn = l2tp_pernet(net);
+0 −2
Original line number Diff line number Diff line
@@ -227,8 +227,6 @@ void l2tp_session_dec_refcount(struct l2tp_session *session);
 */
struct l2tp_tunnel *l2tp_tunnel_get(const struct net *net, u32 tunnel_id);
struct l2tp_tunnel *l2tp_tunnel_get_nth(const struct net *net, int nth);
struct l2tp_session *l2tp_tunnel_get_session(struct l2tp_tunnel *tunnel,
					     u32 session_id);

struct l2tp_session *l2tp_v3_session_get(const struct net *net, struct sock *sk, u32 session_id);
struct l2tp_session *l2tp_v2_session_get(const struct net *net, u16 tunnel_id, u16 session_id);