“e60a10844879794c7b592acf123cbf9ea0e2c0e7”上不存在“drivers/tty/rocket.c”
提交 c74a4611 编写于 作者: A Allan Stephens 提交者: Paul Gortmaker

tipc: Remove duplicate check of message destination node

Eliminates a check in the processing of TIPC messages arriving from
off node that ensures the message is destined for this node, since this
check duplicates an earlier check. (The check would be necessary if TIPC
needed to be able to route incoming messages to another node, but the
elimination of multi-cluster support means that this never happens and
all incoming messages are consumed by the receiving node.)

Note: This change involves the elimination of a single "if" statement
with a large "then" clause; consequently, a significant number of lines
end up getting re-indented. In addition, a simple message header access
routine that is no longer referenced is eliminated. However, the only
functional change is the elimination of the single check described above.
Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
上级 97878a40
...@@ -1773,8 +1773,6 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1773,8 +1773,6 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
if (unlikely(l_ptr->oldest_deferred_in)) if (unlikely(l_ptr->oldest_deferred_in))
head = link_insert_deferred_queue(l_ptr, head = link_insert_deferred_queue(l_ptr,
head); head);
if (likely(msg_is_dest(msg, tipc_own_addr))) {
int ret;
deliver: deliver:
if (likely(msg_isdata(msg))) { if (likely(msg_isdata(msg))) {
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
...@@ -1782,6 +1780,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1782,6 +1780,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
continue; continue;
} }
switch (msg_user(msg)) { switch (msg_user(msg)) {
int ret;
case MSG_BUNDLER: case MSG_BUNDLER:
l_ptr->stats.recv_bundles++; l_ptr->stats.recv_bundles++;
l_ptr->stats.recv_bundled += l_ptr->stats.recv_bundled +=
...@@ -1811,7 +1810,8 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1811,7 +1810,8 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
break; break;
case CHANGEOVER_PROTOCOL: case CHANGEOVER_PROTOCOL:
type = msg_type(msg); type = msg_type(msg);
if (link_recv_changeover_msg(&l_ptr, &buf)) { if (link_recv_changeover_msg(&l_ptr,
&buf)) {
msg = buf_msg(buf); msg = buf_msg(buf);
seq_no = msg_seqno(msg); seq_no = msg_seqno(msg);
if (type == ORIGINAL_MSG) if (type == ORIGINAL_MSG)
...@@ -1824,7 +1824,6 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1824,7 +1824,6 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
buf = NULL; buf = NULL;
break; break;
} }
}
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
tipc_net_route_msg(buf); tipc_net_route_msg(buf);
continue; continue;
......
...@@ -384,11 +384,6 @@ static inline void msg_set_destnode(struct tipc_msg *m, u32 a) ...@@ -384,11 +384,6 @@ static inline void msg_set_destnode(struct tipc_msg *m, u32 a)
msg_set_word(m, 7, a); msg_set_word(m, 7, a);
} }
static inline int msg_is_dest(struct tipc_msg *m, u32 d)
{
return msg_short(m) || (msg_destnode(m) == d);
}
static inline u32 msg_nametype(struct tipc_msg *m) static inline u32 msg_nametype(struct tipc_msg *m)
{ {
return msg_word(m, 8); return msg_word(m, 8);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册