tipc: remove unused 'blocked' flag from tipc_link struct
authorYing Xue <ying.xue@windriver.com>
Wed, 11 Dec 2013 04:45:44 +0000 (20:45 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Dec 2013 05:17:43 +0000 (00:17 -0500)
In early versions of TIPC it was possible to administratively block
individual links through the use of the member flag 'blocked'. This
functionality was deemed redundant, and since commit 7368dd ("tipc:
clean out all instances of #if 0'd unused code"), this flag has been
unused.

In the current code, a link only needs to be blocked for sending and
reception if it is subject to an ongoing link failover. In that case,
it is sufficient to check if the number of expected failover packets
is non-zero, something which is done via the funtion 'link_blocked()'.

This commit finally removes the redundant 'blocked' flag completely.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c
net/tipc/link.h

index ac26f8a657d9e88dd83cb5a28e89101710c10589..3d73144a1ccc4dd59449b3252fb154fe4b339da6 100644 (file)
@@ -488,10 +488,11 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
        if (!l_ptr->started && (event != STARTING_EVT))
                return;         /* Not yet. */
 
-       if (link_blocked(l_ptr)) {
+       /* Check whether changeover is going on */
+       if (l_ptr->exp_msg_count) {
                if (event == TIMEOUT_EVT)
                        link_set_timer(l_ptr, cont_intv);
-               return;   /* Changeover going on */
+               return;
        }
 
        switch (l_ptr->state) {
@@ -1731,7 +1732,8 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ,
                l_ptr->proto_msg_queue = NULL;
        }
 
-       if (link_blocked(l_ptr))
+       /* Don't send protocol message during link changeover */
+       if (l_ptr->exp_msg_count)
                return;
 
        /* Abort non-RESET send if communication with node is prohibited */
@@ -1824,7 +1826,8 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
        u32 msg_tol;
        struct tipc_msg *msg = buf_msg(buf);
 
-       if (link_blocked(l_ptr))
+       /* Discard protocol message during link changeover */
+       if (l_ptr->exp_msg_count)
                goto exit;
 
        /* record unnumbered packet arrival (force mismatch on next timeout) */
index 8a6c1026644db438a1a83b7c2ce5679ac9e5a888..424b1dfe436b44ee5e1fddc86ae0ba431a86833b 100644 (file)
@@ -112,7 +112,6 @@ struct tipc_stats {
  * @continuity_interval: link continuity testing interval [in ms]
  * @abort_limit: # of unacknowledged continuity probes needed to reset link
  * @state: current state of link FSM
- * @blocked: indicates if link has been administratively blocked
  * @fsm_msg_cnt: # of protocol messages link FSM has sent in current state
  * @proto_msg: template for control messages generated by link
  * @pmsg: convenience pointer to "proto_msg" field
@@ -162,7 +161,6 @@ struct tipc_link {
        u32 continuity_interval;
        u32 abort_limit;
        int state;
-       int blocked;
        u32 fsm_msg_cnt;
        struct {
                unchar hdr[INT_H_SIZE];
@@ -312,11 +310,6 @@ static inline int link_reset_reset(struct tipc_link *l_ptr)
        return l_ptr->state == RESET_RESET;
 }
 
-static inline int link_blocked(struct tipc_link *l_ptr)
-{
-       return l_ptr->exp_msg_count || l_ptr->blocked;
-}
-
 static inline int link_congested(struct tipc_link *l_ptr)
 {
        return l_ptr->out_queue_size >= l_ptr->queue_limit[0];