Skip to content

Commit

Permalink
tipc: remove TIPC_NAMES_GONE node flag
Browse files Browse the repository at this point in the history
Since previously what all publications pertaining to the lost node
were removed from name table was finished in tasklet context
asynchronously, we need to TIPC_NAMES_GONE flag indicating whether
the node cleanup work is finished or not. But now as the cleanup work
has been finished when node lock is released, the flag becomes
meaningless for us.

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>
  • Loading branch information
Ying Xue authored and David S. Miller committed May 5, 2014
1 parent 9db9fdd commit 9d56194
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
22 changes: 4 additions & 18 deletions net/tipc/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,6 @@ static void node_established_contact(struct tipc_node *n_ptr)
tipc_bclink_add_node(n_ptr->addr);
}

static void node_name_purge_complete(unsigned long node_addr)
{
struct tipc_node *n_ptr;

n_ptr = tipc_node_find(node_addr);
if (n_ptr) {
tipc_node_lock(n_ptr);
n_ptr->flags &= ~TIPC_NAMES_GONE;
tipc_node_unlock(n_ptr);
}
}

static void node_lost_contact(struct tipc_node *n_ptr)
{
char addr_string[16];
Expand Down Expand Up @@ -320,12 +308,10 @@ static void node_lost_contact(struct tipc_node *n_ptr)
tipc_link_reset_fragments(l_ptr);
}

/* Notify subscribers */
n_ptr->flags = TIPC_NODE_LOST;

/* Prevent re-contact with node until cleanup is done */
n_ptr->flags |= TIPC_NODE_DOWN | TIPC_NAMES_GONE;
tipc_k_signal((Handler)node_name_purge_complete, n_ptr->addr);
/* Notify subscribers and prevent re-contact with node until
* cleanup is done.
*/
n_ptr->flags = TIPC_NODE_DOWN | TIPC_NODE_LOST;
}

struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
Expand Down
8 changes: 3 additions & 5 deletions net/tipc/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@

/* Flags used to block (re)establishment of contact with a neighboring node
* 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_LOST = (1 << 4)
TIPC_NODE_RESET = (1 << 2),
TIPC_NODE_LOST = (1 << 3)
};

/**
Expand Down Expand Up @@ -142,7 +140,7 @@ static inline void tipc_node_lock(struct tipc_node *node)

static inline bool tipc_node_blocked(struct tipc_node *node)
{
return (node->flags & (TIPC_NODE_DOWN | TIPC_NAMES_GONE |
return (node->flags & (TIPC_NODE_DOWN | TIPC_NODE_LOST |
TIPC_NODE_RESET));
}

Expand Down

0 comments on commit 9d56194

Please sign in to comment.