Skip to content

Commit 50c127a

Browse files
edumazetkuba-moo
authored andcommitted
tcp_metrics: use dst_dev_net_rcu()
Replace three dst_dev() with a lockdep enabled helper. Fixes: 4a6ce2b ("net: introduce a new function dst_dev_put()") Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: David Ahern <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 99a2ace commit 50c127a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/ipv4/tcp_metrics.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst,
170170
struct net *net;
171171

172172
spin_lock_bh(&tcp_metrics_lock);
173-
net = dev_net_rcu(dst_dev(dst));
173+
net = dst_dev_net_rcu(dst);
174174

175175
/* While waiting for the spin-lock the cache might have been populated
176176
* with this entry and so we have to check again.
@@ -273,7 +273,7 @@ static struct tcp_metrics_block *__tcp_get_metrics_req(struct request_sock *req,
273273
return NULL;
274274
}
275275

276-
net = dev_net_rcu(dst_dev(dst));
276+
net = dst_dev_net_rcu(dst);
277277
hash ^= net_hash_mix(net);
278278
hash = hash_32(hash, tcp_metrics_hash_log);
279279

@@ -318,7 +318,7 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk,
318318
else
319319
return NULL;
320320

321-
net = dev_net_rcu(dst_dev(dst));
321+
net = dst_dev_net_rcu(dst);
322322
hash ^= net_hash_mix(net);
323323
hash = hash_32(hash, tcp_metrics_hash_log);
324324

0 commit comments

Comments
 (0)