diff options
Diffstat (limited to 'net/tipc/port.h')
-rw-r--r-- | net/tipc/port.h | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/net/tipc/port.h b/net/tipc/port.h index f4a8c2be3faa..839f100da646 100644 --- a/net/tipc/port.h +++ b/net/tipc/port.h | |||
@@ -110,65 +110,65 @@ struct port { | |||
110 | struct node_subscr subscription; | 110 | struct node_subscr subscription; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern spinlock_t port_list_lock; | 113 | extern spinlock_t tipc_port_list_lock; |
114 | struct port_list; | 114 | struct port_list; |
115 | 115 | ||
116 | int port_recv_sections(struct port *p_ptr, u32 num_sect, | 116 | int tipc_port_recv_sections(struct port *p_ptr, u32 num_sect, |
117 | struct iovec const *msg_sect); | 117 | struct iovec const *msg_sect); |
118 | int port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr, | 118 | int tipc_port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr, |
119 | struct iovec const *msg_sect, u32 num_sect, | 119 | struct iovec const *msg_sect, u32 num_sect, |
120 | int err); | 120 | int err); |
121 | struct sk_buff *port_get_ports(void); | 121 | struct sk_buff *tipc_port_get_ports(void); |
122 | struct sk_buff *port_show_stats(const void *req_tlv_area, int req_tlv_space); | 122 | struct sk_buff *port_show_stats(const void *req_tlv_area, int req_tlv_space); |
123 | void port_recv_proto_msg(struct sk_buff *buf); | 123 | void tipc_port_recv_proto_msg(struct sk_buff *buf); |
124 | void port_recv_mcast(struct sk_buff *buf, struct port_list *dp); | 124 | void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp); |
125 | void port_reinit(void); | 125 | void tipc_port_reinit(void); |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * port_lock - lock port instance referred to and return its pointer | 128 | * tipc_port_lock - lock port instance referred to and return its pointer |
129 | */ | 129 | */ |
130 | 130 | ||
131 | static inline struct port *port_lock(u32 ref) | 131 | static inline struct port *tipc_port_lock(u32 ref) |
132 | { | 132 | { |
133 | return (struct port *)ref_lock(ref); | 133 | return (struct port *)tipc_ref_lock(ref); |
134 | } | 134 | } |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * port_unlock - unlock a port instance | 137 | * tipc_port_unlock - unlock a port instance |
138 | * | 138 | * |
139 | * Can use pointer instead of ref_unlock() since port is already locked. | 139 | * Can use pointer instead of tipc_ref_unlock() since port is already locked. |
140 | */ | 140 | */ |
141 | 141 | ||
142 | static inline void port_unlock(struct port *p_ptr) | 142 | static inline void tipc_port_unlock(struct port *p_ptr) |
143 | { | 143 | { |
144 | spin_unlock_bh(p_ptr->publ.lock); | 144 | spin_unlock_bh(p_ptr->publ.lock); |
145 | } | 145 | } |
146 | 146 | ||
147 | static inline struct port* port_deref(u32 ref) | 147 | static inline struct port* tipc_port_deref(u32 ref) |
148 | { | 148 | { |
149 | return (struct port *)ref_deref(ref); | 149 | return (struct port *)tipc_ref_deref(ref); |
150 | } | 150 | } |
151 | 151 | ||
152 | static inline u32 peer_port(struct port *p_ptr) | 152 | static inline u32 tipc_peer_port(struct port *p_ptr) |
153 | { | 153 | { |
154 | return msg_destport(&p_ptr->publ.phdr); | 154 | return msg_destport(&p_ptr->publ.phdr); |
155 | } | 155 | } |
156 | 156 | ||
157 | static inline u32 peer_node(struct port *p_ptr) | 157 | static inline u32 tipc_peer_node(struct port *p_ptr) |
158 | { | 158 | { |
159 | return msg_destnode(&p_ptr->publ.phdr); | 159 | return msg_destnode(&p_ptr->publ.phdr); |
160 | } | 160 | } |
161 | 161 | ||
162 | static inline int port_congested(struct port *p_ptr) | 162 | static inline int tipc_port_congested(struct port *p_ptr) |
163 | { | 163 | { |
164 | return((p_ptr->sent - p_ptr->acked) >= (TIPC_FLOW_CONTROL_WIN * 2)); | 164 | return((p_ptr->sent - p_ptr->acked) >= (TIPC_FLOW_CONTROL_WIN * 2)); |
165 | } | 165 | } |
166 | 166 | ||
167 | /** | 167 | /** |
168 | * port_recv_msg - receive message from lower layer and deliver to port user | 168 | * tipc_port_recv_msg - receive message from lower layer and deliver to port user |
169 | */ | 169 | */ |
170 | 170 | ||
171 | static inline int port_recv_msg(struct sk_buff *buf) | 171 | static inline int tipc_port_recv_msg(struct sk_buff *buf) |
172 | { | 172 | { |
173 | struct port *p_ptr; | 173 | struct port *p_ptr; |
174 | struct tipc_msg *msg = buf_msg(buf); | 174 | struct tipc_msg *msg = buf_msg(buf); |
@@ -178,24 +178,24 @@ static inline int port_recv_msg(struct sk_buff *buf) | |||
178 | 178 | ||
179 | /* forward unresolved named message */ | 179 | /* forward unresolved named message */ |
180 | if (unlikely(!destport)) { | 180 | if (unlikely(!destport)) { |
181 | net_route_msg(buf); | 181 | tipc_net_route_msg(buf); |
182 | return dsz; | 182 | return dsz; |
183 | } | 183 | } |
184 | 184 | ||
185 | /* validate destination & pass to port, otherwise reject message */ | 185 | /* validate destination & pass to port, otherwise reject message */ |
186 | p_ptr = port_lock(destport); | 186 | p_ptr = tipc_port_lock(destport); |
187 | if (likely(p_ptr)) { | 187 | if (likely(p_ptr)) { |
188 | if (likely(p_ptr->publ.connected)) { | 188 | if (likely(p_ptr->publ.connected)) { |
189 | if ((unlikely(msg_origport(msg) != peer_port(p_ptr))) || | 189 | if ((unlikely(msg_origport(msg) != tipc_peer_port(p_ptr))) || |
190 | (unlikely(msg_orignode(msg) != peer_node(p_ptr))) || | 190 | (unlikely(msg_orignode(msg) != tipc_peer_node(p_ptr))) || |
191 | (unlikely(!msg_connected(msg)))) { | 191 | (unlikely(!msg_connected(msg)))) { |
192 | err = TIPC_ERR_NO_PORT; | 192 | err = TIPC_ERR_NO_PORT; |
193 | port_unlock(p_ptr); | 193 | tipc_port_unlock(p_ptr); |
194 | goto reject; | 194 | goto reject; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | err = p_ptr->dispatcher(&p_ptr->publ, buf); | 197 | err = p_ptr->dispatcher(&p_ptr->publ, buf); |
198 | port_unlock(p_ptr); | 198 | tipc_port_unlock(p_ptr); |
199 | if (likely(!err)) | 199 | if (likely(!err)) |
200 | return dsz; | 200 | return dsz; |
201 | } else { | 201 | } else { |