[TIPC]: Update version to 1.6.3
[safe/jmp/linux-2.6] / net / tipc / port.c
index 5d2b9ce..e2646a9 100644 (file)
@@ -41,7 +41,6 @@
 #include "addr.h"
 #include "link.h"
 #include "node.h"
-#include "port.h"
 #include "name_table.h"
 #include "user_reg.h"
 #include "msg.h"
@@ -243,7 +242,8 @@ u32 tipc_createport_raw(void *usr_handle,
        p_ptr->publ.max_pkt = MAX_PKT_DEFAULT;
        p_ptr->publ.ref = ref;
        msg = &p_ptr->publ.phdr;
-       msg_init(msg, DATA_LOW, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, 0);
+       msg_init(msg, TIPC_LOW_IMPORTANCE, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE,
+                0);
        msg_set_orignode(msg, tipc_own_addr);
        msg_set_prevnode(msg, tipc_own_addr);
        msg_set_origport(msg, ref);
@@ -341,7 +341,7 @@ int tipc_portunreliable(u32 ref, unsigned int *isunreliable)
        if (!p_ptr)
                return -EINVAL;
        *isunreliable = port_unreliable(p_ptr);
-       spin_unlock_bh(p_ptr->publ.lock);
+       tipc_port_unlock(p_ptr);
        return TIPC_OK;
 }
 
@@ -370,7 +370,7 @@ int tipc_portunreturnable(u32 ref, unsigned int *isunrejectable)
        if (!p_ptr)
                return -EINVAL;
        *isunrejectable = port_unreturnable(p_ptr);
-       spin_unlock_bh(p_ptr->publ.lock);
+       tipc_port_unlock(p_ptr);
        return TIPC_OK;
 }
 
@@ -414,13 +414,6 @@ static struct sk_buff *port_build_proto_msg(u32 destport, u32 destnode,
        return buf;
 }
 
-int tipc_set_msg_option(struct tipc_port *tp_ptr, const char *opt, const u32 sz)
-{
-       msg_expand(&tp_ptr->phdr, msg_destnode(&tp_ptr->phdr));
-       msg_set_options(&tp_ptr->phdr, opt, sz);
-       return TIPC_OK;
-}
-
 int tipc_reject_msg(struct sk_buff *buf, u32 err)
 {
        struct tipc_msg *msg = buf_msg(buf);
@@ -633,7 +626,7 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
                                             msg_orignode(msg),
                                             msg_destport(msg),
                                             tipc_own_addr,
-                                            DATA_HIGH,
+                                            TIPC_HIGH_IMPORTANCE,
                                             TIPC_CONN_MSG,
                                             err,
                                             0,
@@ -844,7 +837,7 @@ static void port_dispatcher_sigh(void *dummy)
                                u32 peer_port = port_peerport(p_ptr);
                                u32 peer_node = port_peernode(p_ptr);
 
-                               spin_unlock_bh(p_ptr->publ.lock);
+                               tipc_port_unlock(p_ptr);
                                if (unlikely(!connected)) {
                                        if (unlikely(published))
                                                goto reject;
@@ -868,7 +861,7 @@ static void port_dispatcher_sigh(void *dummy)
                case TIPC_DIRECT_MSG:{
                                tipc_msg_event cb = up_ptr->msg_cb;
 
-                               spin_unlock_bh(p_ptr->publ.lock);
+                               tipc_port_unlock(p_ptr);
                                if (unlikely(connected))
                                        goto reject;
                                if (unlikely(!cb))
@@ -883,7 +876,7 @@ static void port_dispatcher_sigh(void *dummy)
                case TIPC_NAMED_MSG:{
                                tipc_named_msg_event cb = up_ptr->named_msg_cb;
 
-                               spin_unlock_bh(p_ptr->publ.lock);
+                               tipc_port_unlock(p_ptr);
                                if (unlikely(connected))
                                        goto reject;
                                if (unlikely(!cb))
@@ -914,7 +907,7 @@ err:
                                u32 peer_port = port_peerport(p_ptr);
                                u32 peer_node = port_peernode(p_ptr);
 
-                               spin_unlock_bh(p_ptr->publ.lock);
+                               tipc_port_unlock(p_ptr);
                                if (!connected || !cb)
                                        break;
                                if (msg_origport(msg) != peer_port)
@@ -930,7 +923,7 @@ err:
                case TIPC_DIRECT_MSG:{
                                tipc_msg_err_event cb = up_ptr->err_cb;
 
-                               spin_unlock_bh(p_ptr->publ.lock);
+                               tipc_port_unlock(p_ptr);
                                if (connected || !cb)
                                        break;
                                skb_pull(buf, msg_hdr_sz(msg));
@@ -943,7 +936,7 @@ err:
                                tipc_named_msg_err_event cb =
                                        up_ptr->named_err_cb;
 
-                               spin_unlock_bh(p_ptr->publ.lock);
+                               tipc_port_unlock(p_ptr);
                                if (connected || !cb)
                                        break;
                                dseq.type =  msg_nametype(msg);
@@ -1108,7 +1101,7 @@ int tipc_portimportance(u32 ref, unsigned int *importance)
        if (!p_ptr)
                return -EINVAL;
        *importance = (unsigned int)msg_importance(&p_ptr->publ.phdr);
-       spin_unlock_bh(p_ptr->publ.lock);
+       tipc_port_unlock(p_ptr);
        return TIPC_OK;
 }
 
@@ -1123,7 +1116,7 @@ int tipc_set_portimportance(u32 ref, unsigned int imp)
        if (!p_ptr)
                return -EINVAL;
        msg_set_importance(&p_ptr->publ.phdr, (u32)imp);
-       spin_unlock_bh(p_ptr->publ.lock);
+       tipc_port_unlock(p_ptr);
        return TIPC_OK;
 }