summaryrefslogtreecommitdiff
path: root/net/tipc/node.h
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-05-05 04:56:12 +0400
committerDavid S. Miller <davem@davemloft.net>2014-05-06 01:26:44 +0400
commit9db9fdd1983eb960182d72f95d77b91b3a5173d0 (patch)
tree0c4d21174478529972f3b630f7b1daa6f018f134 /net/tipc/node.h
parent10f465c4966fbc8f50a59480d37a3451f6f3d564 (diff)
downloadlinux-9db9fdd1983eb960182d72f95d77b91b3a5173d0.tar.xz
tipc: avoid to asynchronously notify subscriptions
Postpone the actions of notifying subscriptions until after node lock is released, avoiding to asynchronously execute registered handlers when node is lost. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.h')
-rw-r--r--net/tipc/node.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 242b918ddd14..fd86726ed192 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -51,11 +51,14 @@
* TIPC_NODE_DOWN: indicate node is down
* TIPC_NAMES_GONE: indicate the node's publications are purged
* TIPC_NODE_RESET: indicate node is reset
+ * TIPC_NODE_LOST: indicate node is lost and it's used to notify subscriptions
+ * when node lock is released
*/
enum {
TIPC_NODE_DOWN = (1 << 1),
TIPC_NAMES_GONE = (1 << 2),
- TIPC_NODE_RESET = (1 << 3)
+ TIPC_NODE_RESET = (1 << 3),
+ TIPC_NODE_LOST = (1 << 4)
};
/**
@@ -130,15 +133,11 @@ int tipc_node_is_up(struct tipc_node *n_ptr);
struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space);
struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space);
int tipc_node_get_linkname(u32 bearer_id, u32 node, char *linkname, size_t len);
+void tipc_node_unlock(struct tipc_node *node);
-static inline void tipc_node_lock(struct tipc_node *n_ptr)
+static inline void tipc_node_lock(struct tipc_node *node)
{
- spin_lock_bh(&n_ptr->lock);
-}
-
-static inline void tipc_node_unlock(struct tipc_node *n_ptr)
-{
- spin_unlock_bh(&n_ptr->lock);
+ spin_lock_bh(&node->lock);
}
static inline bool tipc_node_blocked(struct tipc_node *node)