]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: add reference counter to bearer
authorTuong Lien <tuong.t.lien@dektech.com.au>
Fri, 8 Nov 2019 05:05:08 +0000 (12:05 +0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Nov 2019 22:01:59 +0000 (14:01 -0800)
commite323f82a06a6d05b1965ed1bf19b8a3501589f72
tree5db483507dfbc4b82a8097cd1c6562f2a6c0f99a
parentbc0158b4ff737d6941a81219092a11fcf1effe46
tipc: add reference counter to bearer

As a need to support the crypto asynchronous operations in the later
commits, apart from the current RCU mechanism for bearer pointer, we
add a 'refcnt' to the bearer object as well.

So, a bearer can be hold via 'tipc_bearer_hold()' without being freed
even though the bearer or interface can be disabled in the meanwhile.
If that happens, the bearer will be released then when the crypto
operation is completed and 'tipc_bearer_put()' is called.

Acked-by: Ying Xue <ying.xue@windreiver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bearer.c
net/tipc/bearer.h