Lines Matching refs:pd
43 static void l2tp_dfs_next_tunnel(struct l2tp_dfs_seq_data *pd) in l2tp_dfs_next_tunnel() argument
46 if (pd->tunnel) in l2tp_dfs_next_tunnel()
47 l2tp_tunnel_dec_refcount(pd->tunnel); in l2tp_dfs_next_tunnel()
49 pd->tunnel = l2tp_tunnel_get_nth(pd->net, pd->tunnel_idx); in l2tp_dfs_next_tunnel()
50 pd->tunnel_idx++; in l2tp_dfs_next_tunnel()
53 static void l2tp_dfs_next_session(struct l2tp_dfs_seq_data *pd) in l2tp_dfs_next_session() argument
56 if (pd->session) in l2tp_dfs_next_session()
57 l2tp_session_dec_refcount(pd->session); in l2tp_dfs_next_session()
59 pd->session = l2tp_session_get_nth(pd->tunnel, pd->session_idx); in l2tp_dfs_next_session()
60 pd->session_idx++; in l2tp_dfs_next_session()
62 if (!pd->session) { in l2tp_dfs_next_session()
63 pd->session_idx = 0; in l2tp_dfs_next_session()
64 l2tp_dfs_next_tunnel(pd); in l2tp_dfs_next_session()
70 struct l2tp_dfs_seq_data *pd = SEQ_START_TOKEN; in l2tp_dfs_seq_start() local
77 pd = NULL; in l2tp_dfs_seq_start()
80 pd = m->private; in l2tp_dfs_seq_start()
82 if (!pd->tunnel) in l2tp_dfs_seq_start()
83 l2tp_dfs_next_tunnel(pd); in l2tp_dfs_seq_start()
85 l2tp_dfs_next_session(pd); in l2tp_dfs_seq_start()
88 if (!pd->tunnel && !pd->session) in l2tp_dfs_seq_start()
89 pd = NULL; in l2tp_dfs_seq_start()
92 return pd; in l2tp_dfs_seq_start()
103 struct l2tp_dfs_seq_data *pd = v; in l2tp_dfs_seq_stop() local
105 if (!pd || pd == SEQ_START_TOKEN) in l2tp_dfs_seq_stop()
111 if (pd->session) { in l2tp_dfs_seq_stop()
112 l2tp_session_dec_refcount(pd->session); in l2tp_dfs_seq_stop()
113 pd->session = NULL; in l2tp_dfs_seq_stop()
115 if (pd->tunnel) { in l2tp_dfs_seq_stop()
116 l2tp_tunnel_dec_refcount(pd->tunnel); in l2tp_dfs_seq_stop()
117 pd->tunnel = NULL; in l2tp_dfs_seq_stop()
233 struct l2tp_dfs_seq_data *pd = v; in l2tp_dfs_seq_show() local
251 if (!pd->session) in l2tp_dfs_seq_show()
252 l2tp_dfs_seq_tunnel_show(m, pd->tunnel); in l2tp_dfs_seq_show()
254 l2tp_dfs_seq_session_show(m, pd->session); in l2tp_dfs_seq_show()
269 struct l2tp_dfs_seq_data *pd; in l2tp_dfs_seq_open() local
273 pd = kzalloc(sizeof(*pd), GFP_KERNEL); in l2tp_dfs_seq_open()
274 if (!pd) in l2tp_dfs_seq_open()
280 pd->net = get_net_ns_by_pid(current->pid); in l2tp_dfs_seq_open()
281 if (IS_ERR(pd->net)) { in l2tp_dfs_seq_open()
282 rc = PTR_ERR(pd->net); in l2tp_dfs_seq_open()
285 netns_tracker_alloc(pd->net, &pd->ns_tracker, GFP_KERNEL); in l2tp_dfs_seq_open()
291 seq->private = pd; in l2tp_dfs_seq_open()
297 put_net_track(pd->net, &pd->ns_tracker); in l2tp_dfs_seq_open()
299 kfree(pd); in l2tp_dfs_seq_open()
305 struct l2tp_dfs_seq_data *pd; in l2tp_dfs_seq_release() local
309 pd = seq->private; in l2tp_dfs_seq_release()
310 if (pd->net) in l2tp_dfs_seq_release()
311 put_net_track(pd->net, &pd->ns_tracker); in l2tp_dfs_seq_release()
312 kfree(pd); in l2tp_dfs_seq_release()