diff options
author | David S. Miller <davem@davemloft.net> | 2019-08-07 04:44:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-07 04:44:57 +0300 |
commit | 13dfb3fa494361ea9a5950f27c9cd8b06d28c04f (patch) | |
tree | 1bf30874f57c6c6b21160a10282191fcd0868055 /net/rxrpc/peer_object.c | |
parent | 05bb520376af2c5146d3c44832c22ec3bb54d778 (diff) | |
parent | 33920f1ec5bf47c5c0a1d2113989bdd9dfb3fae9 (diff) | |
download | linux-13dfb3fa494361ea9a5950f27c9cd8b06d28c04f.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Just minor overlapping changes in the conflicts here.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc/peer_object.c')
-rw-r--r-- | net/rxrpc/peer_object.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/rxrpc/peer_object.c b/net/rxrpc/peer_object.c index 9d3ce81cf8ae..9c3ac96f71cb 100644 --- a/net/rxrpc/peer_object.c +++ b/net/rxrpc/peer_object.c @@ -437,6 +437,24 @@ void rxrpc_put_peer(struct rxrpc_peer *peer) } /* + * Drop a ref on a peer record where the caller already holds the + * peer_hash_lock. + */ +void rxrpc_put_peer_locked(struct rxrpc_peer *peer) +{ + const void *here = __builtin_return_address(0); + int n; + + n = atomic_dec_return(&peer->usage); + trace_rxrpc_peer(peer, rxrpc_peer_put, n, here); + if (n == 0) { + hash_del_rcu(&peer->hash_link); + list_del_init(&peer->keepalive_link); + kfree_rcu(peer, rcu); + } +} + +/* * Make sure all peer records have been discarded. */ void rxrpc_destroy_all_peers(struct rxrpc_net *rxnet) |