summaryrefslogtreecommitdiff
path: root/net/l2tp/l2tp_debugfs.c
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2024-08-07 07:54:50 +0100
committerDavid S. Miller <davem@davemloft.net>2024-08-11 04:38:50 +0100
commitabe7a1a7d0b69e63b1bca5f9531023a52336784f (patch)
tree1d491c6b824af17f97ef97824f5f61c8126a351d /net/l2tp/l2tp_debugfs.c
parent1f4c3dce9112d23145b4f8bbfd3793a1c4c517ab (diff)
downloadlwn-abe7a1a7d0b69e63b1bca5f9531023a52336784f.tar.gz
lwn-abe7a1a7d0b69e63b1bca5f9531023a52336784f.zip
l2tp: improve tunnel/session refcount helpers
l2tp_tunnel_inc_refcount and l2tp_session_inc_refcount wrap refcount_inc. They add no value so just use the refcount APIs directly and drop l2tp's helpers. l2tp already uses refcount_inc_not_zero anyway. Rename l2tp_tunnel_dec_refcount and l2tp_session_dec_refcount to l2tp_tunnel_put and l2tp_session_put to better match their use pairing various _get getters. Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_debugfs.c')
-rw-r--r--net/l2tp/l2tp_debugfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index b2134b57ed18..2d0c8275a3a8 100644
--- a/net/l2tp/l2tp_debugfs.c
+++ b/net/l2tp/l2tp_debugfs.c
@@ -44,7 +44,7 @@ static void l2tp_dfs_next_tunnel(struct l2tp_dfs_seq_data *pd)
{
/* Drop reference taken during previous invocation */
if (pd->tunnel)
- l2tp_tunnel_dec_refcount(pd->tunnel);
+ l2tp_tunnel_put(pd->tunnel);
pd->tunnel = l2tp_tunnel_get_next(pd->net, &pd->tkey);
pd->tkey++;
@@ -54,7 +54,7 @@ static void l2tp_dfs_next_session(struct l2tp_dfs_seq_data *pd)
{
/* Drop reference taken during previous invocation */
if (pd->session)
- l2tp_session_dec_refcount(pd->session);
+ l2tp_session_put(pd->session);
pd->session = l2tp_session_get_next(pd->net, pd->tunnel->sock,
pd->tunnel->version,
@@ -111,11 +111,11 @@ static void l2tp_dfs_seq_stop(struct seq_file *p, void *v)
* or l2tp_dfs_next_tunnel().
*/
if (pd->session) {
- l2tp_session_dec_refcount(pd->session);
+ l2tp_session_put(pd->session);
pd->session = NULL;
}
if (pd->tunnel) {
- l2tp_tunnel_dec_refcount(pd->tunnel);
+ l2tp_tunnel_put(pd->tunnel);
pd->tunnel = NULL;
}
}