mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
l2tp: replace hlist with simple list for per-tunnel session list
The per-tunnel session list is no longer used by the datapath. However, we still need a list of sessions in the tunnel for l2tp_session_get_nth, which is used by management code. (An alternative might be to walk each session IDR list, matching only sessions of a given tunnel.) Replace the per-tunnel hlist with a per-tunnel list. In functions which walk a list of sessions of a tunnel, walk this list instead. Signed-off-by: James Chapman <jchapman@katalix.com> Reviewed-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
8c6245af4f
commit
d18d3f0a24
@@ -123,17 +123,14 @@ static void l2tp_dfs_seq_tunnel_show(struct seq_file *m, void *v)
|
||||
struct l2tp_tunnel *tunnel = v;
|
||||
struct l2tp_session *session;
|
||||
int session_count = 0;
|
||||
int hash;
|
||||
|
||||
rcu_read_lock_bh();
|
||||
for (hash = 0; hash < L2TP_HASH_SIZE; hash++) {
|
||||
hlist_for_each_entry_rcu(session, &tunnel->session_hlist[hash], hlist) {
|
||||
/* Session ID of zero is a dummy/reserved value used by pppol2tp */
|
||||
if (session->session_id == 0)
|
||||
continue;
|
||||
list_for_each_entry_rcu(session, &tunnel->session_list, list) {
|
||||
/* Session ID of zero is a dummy/reserved value used by pppol2tp */
|
||||
if (session->session_id == 0)
|
||||
continue;
|
||||
|
||||
session_count++;
|
||||
}
|
||||
session_count++;
|
||||
}
|
||||
rcu_read_unlock_bh();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user