Lines Matching +full:loss +full:- +full:of +full:- +full:lock
4 * Copyright (c) 1995-2006, 2014, Ericsson AB
5 * Copyright (c) 2005, 2010-2011, Wind River Systems
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * notice, this list of conditions and the following disclaimer in the
16 * 3. Neither the names of the copyright holders nor the names of its
20 * Alternatively, this software may be distributed under the terms of the
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
51 * port and node/link instances. The code consists of four major
52 * locking domains, each protected with their own disjunct set of locks.
55 * RTNL lock is used to serialize the process of configuring bearer
56 * on update side, and RCU lock is applied on read side to make
57 * bearer instance valid on both paths of message transmission and
63 * and they are guarded with RCU lock on read side. Especially node
71 * are protected by node spin lock.
73 * 3: The transport level of the protocol.
74 * This consists of the structures port, (and its user level
79 * - The tipc_port spin_lock. This is protecting each port instance
81 * this lock in the port itself, it has been placed in the
84 * outside the TIPC core, however, so a pointer to the lock has
85 * been added in the port instance, -to be used for unlocking
87 * - A read/write lock to protect the reference table itself (teg.c).
88 * (Nobody is using read-only access to this, so it can just as
90 * - A spin lock to protect the registry of kernel/driver users (reg.c)
91 * - A global spin_lock (tipc_port_lock), which only task is to ensure
93 * i.e., when a port is part of a linked list of ports.
98 * - There is one big read/write-lock (tipc_nametbl_lock) protecting the
101 * - There is one local spin_lock per sub_sequence, which can be seen
102 * as a sub-domain to the tipc_nametbl_lock domain. It is used only
104 * steps the root of the 'publication' linked list between each lookup.
105 * This is always used within the scope of a tipc_nametbl_lock(read).
106 * - A local spin_lock protecting the queue of subscriber events.
115 return -1; in tipc_net_init()
135 if (cmpxchg(&tn->node_addr, 0, addr)) in tipc_net_finalize()
148 tipc_net_finalize(tipc_link_net(tn->bcl), tn->trial_addr); in tipc_net_finalize_work()
167 u64 *w0 = (u64 *)&tn->node_id[0]; in __tipc_nl_add_net()
168 u64 *w1 = (u64 *)&tn->node_id[8]; in __tipc_nl_add_net()
172 hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, in __tipc_nl_add_net()
175 return -EMSGSIZE; in __tipc_nl_add_net()
177 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_NET); in __tipc_nl_add_net()
181 if (nla_put_u32(msg->skb, TIPC_NLA_NET_ID, tn->net_id)) in __tipc_nl_add_net()
183 if (nla_put_u64_64bit(msg->skb, TIPC_NLA_NET_NODEID, *w0, 0)) in __tipc_nl_add_net()
185 if (nla_put_u64_64bit(msg->skb, TIPC_NLA_NET_NODEID_W1, *w1, 0)) in __tipc_nl_add_net()
187 nla_nest_end(msg->skb, attrs); in __tipc_nl_add_net()
188 genlmsg_end(msg->skb, hdr); in __tipc_nl_add_net()
193 nla_nest_cancel(msg->skb, attrs); in __tipc_nl_add_net()
195 genlmsg_cancel(msg->skb, hdr); in __tipc_nl_add_net()
197 return -EMSGSIZE; in __tipc_nl_add_net()
202 struct net *net = sock_net(skb->sk); in tipc_nl_net_dump()
204 int done = cb->args[0]; in tipc_nl_net_dump()
211 msg.portid = NETLINK_CB(cb->skb).portid; in tipc_nl_net_dump()
212 msg.seq = cb->nlh->nlmsg_seq; in tipc_nl_net_dump()
220 cb->args[0] = done; in tipc_nl_net_dump()
222 return skb->len; in tipc_nl_net_dump()
228 struct net *net = sock_net(skb->sk); in __tipc_nl_net_set()
232 if (!info->attrs[TIPC_NLA_NET]) in __tipc_nl_net_set()
233 return -EINVAL; in __tipc_nl_net_set()
236 info->attrs[TIPC_NLA_NET], in __tipc_nl_net_set()
237 tipc_nl_net_policy, info->extack); in __tipc_nl_net_set()
244 return -EPERM; in __tipc_nl_net_set()
251 return -EINVAL; in __tipc_nl_net_set()
253 tn->net_id = val; in __tipc_nl_net_set()
261 return -EINVAL; in __tipc_nl_net_set()
262 tn->legacy_addr_format = true; in __tipc_nl_net_set()
272 return -EINVAL; in __tipc_nl_net_set()
297 hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, in __tipc_nl_addr_legacy_get()
300 return -EMSGSIZE; in __tipc_nl_addr_legacy_get()
302 attrs = nla_nest_start(msg->skb, TIPC_NLA_NET); in __tipc_nl_addr_legacy_get()
306 if (tn->legacy_addr_format) in __tipc_nl_addr_legacy_get()
307 if (nla_put_flag(msg->skb, TIPC_NLA_NET_ADDR_LEGACY)) in __tipc_nl_addr_legacy_get()
310 nla_nest_end(msg->skb, attrs); in __tipc_nl_addr_legacy_get()
311 genlmsg_end(msg->skb, hdr); in __tipc_nl_addr_legacy_get()
316 nla_nest_cancel(msg->skb, attrs); in __tipc_nl_addr_legacy_get()
318 genlmsg_cancel(msg->skb, hdr); in __tipc_nl_addr_legacy_get()
320 return -EMSGSIZE; in __tipc_nl_addr_legacy_get()
325 struct net *net = sock_net(skb->sk); in tipc_nl_net_addr_legacy_get()
332 return -ENOMEM; in tipc_nl_net_addr_legacy_get()
335 msg.portid = info->snd_portid; in tipc_nl_net_addr_legacy_get()
336 msg.seq = info->snd_seq; in tipc_nl_net_addr_legacy_get()