diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-05-05 08:56:12 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-05 17:26:44 -0400 |
commit | 9db9fdd1983eb960182d72f95d77b91b3a5173d0 (patch) | |
tree | 0c4d21174478529972f3b630f7b1daa6f018f134 /net/tipc/node.h | |
parent | 10f465c4966fbc8f50a59480d37a3451f6f3d564 (diff) | |
download | op-kernel-dev-9db9fdd1983eb960182d72f95d77b91b3a5173d0.zip op-kernel-dev-9db9fdd1983eb960182d72f95d77b91b3a5173d0.tar.gz |
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.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/tipc/node.h b/net/tipc/node.h index 242b918..fd86726 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) |