summaryrefslogtreecommitdiff
path: root/net/tipc/subscr.h
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2017-03-28 13:28:28 +0300
committerDavid S. Miller <davem@davemloft.net>2017-03-29 04:03:33 +0300
commit7efea60dcffc151870d1abbfccdb1f11cd4b7f21 (patch)
tree17bdb6c1fe9c4a204421de23f7f347073b868deb /net/tipc/subscr.h
parent139bb36f754adbf6d3c836db09d6459e25167b38 (diff)
downloadlinux-7efea60dcffc151870d1abbfccdb1f11cd4b7f21.tar.xz
tipc: adjust the policy of holding subscription kref
When a new subscription object is inserted into name_seq->subscriptions list, it's under name_seq->lock protection; when a subscription is deleted from the list, it's also under the same lock protection; similarly, when accessing a subscription by going through subscriptions list, the entire process is also protected by the name_seq->lock. Therefore, if subscription refcount is increased before it's inserted into subscriptions list, and its refcount is decreased after it's deleted from the list, it will be unnecessary to hold refcount at all before accessing subscription object which is obtained by going through subscriptions list under name_seq->lock protection. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/subscr.h')
-rw-r--r--net/tipc/subscr.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/subscr.h b/net/tipc/subscr.h
index ffdc214c117a..ee52957dc952 100644
--- a/net/tipc/subscr.h
+++ b/net/tipc/subscr.h
@@ -78,4 +78,7 @@ u32 tipc_subscrp_convert_seq_type(u32 type, int swap);
int tipc_topsrv_start(struct net *net);
void tipc_topsrv_stop(struct net *net);
+void tipc_subscrp_put(struct tipc_subscription *subscription);
+void tipc_subscrp_get(struct tipc_subscription *subscription);
+
#endif