Lines Matching +full:loss +full:- +full:of +full:- +full:lock

4  * Copyright (c) 2000-2017, Ericsson AB
5 * Copyright (c) 2005-2007, 2010-2013, Wind River Systems
6 * Copyright (c) 2020-2021, Red Hat Inc
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * notice, this list of conditions and the following disclaimer in the
17 * 3. Neither the names of the copyright holders nor the names of its
21 * Alternatively, this software may be distributed under the terms of the
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
46 struct tipc_subscr *s = &sub->evt.s; in tipc_sub_send_event()
47 struct tipc_event *evt = &sub->evt; in tipc_sub_send_event()
49 if (sub->inactive) in tipc_sub_send_event()
53 tipc_evt_write(evt, found_lower, p->sr.lower); in tipc_sub_send_event()
54 tipc_evt_write(evt, found_upper, p->sr.upper); in tipc_sub_send_event()
55 tipc_evt_write(evt, port.ref, p->sk.ref); in tipc_sub_send_event()
56 tipc_evt_write(evt, port.node, p->sk.node); in tipc_sub_send_event()
58 tipc_evt_write(evt, found_lower, s->seq.lower); in tipc_sub_send_event()
59 tipc_evt_write(evt, found_upper, s->seq.upper); in tipc_sub_send_event()
63 tipc_topsrv_queue_evt(sub->net, sub->conid, event, evt); in tipc_sub_send_event()
67 * tipc_sub_check_overlap - test for subscription overlap with the given values
76 u32 found_lower = found->lower; in tipc_sub_check_overlap()
77 u32 found_upper = found->upper; in tipc_sub_check_overlap()
79 if (found_lower < subscribed->lower) in tipc_sub_check_overlap()
80 found_lower = subscribed->lower; in tipc_sub_check_overlap()
81 if (found_upper > subscribed->upper) in tipc_sub_check_overlap()
82 found_upper = subscribed->upper; in tipc_sub_check_overlap()
90 struct tipc_service_range *sr = &sub->s.seq; in tipc_sub_report_overlap()
91 u32 filter = sub->s.filter; in tipc_sub_report_overlap()
93 if (!tipc_sub_check_overlap(sr, &p->sr)) in tipc_sub_report_overlap()
97 if (filter & TIPC_SUB_CLUSTER_SCOPE && p->scope == TIPC_NODE_SCOPE) in tipc_sub_report_overlap()
99 if (filter & TIPC_SUB_NODE_SCOPE && p->scope != TIPC_NODE_SCOPE) in tipc_sub_report_overlap()
101 spin_lock(&sub->lock); in tipc_sub_report_overlap()
103 spin_unlock(&sub->lock); in tipc_sub_report_overlap()
110 spin_lock(&sub->lock); in tipc_sub_timeout()
112 sub->inactive = true; in tipc_sub_timeout()
113 spin_unlock(&sub->lock); in tipc_sub_timeout()
123 kref_put(&subscription->kref, tipc_sub_kref_release); in tipc_sub_put()
128 kref_get(&subscription->kref); in tipc_sub_get()
151 INIT_LIST_HEAD(&sub->service_list); in tipc_sub_subscribe()
152 INIT_LIST_HEAD(&sub->sub_list); in tipc_sub_subscribe()
153 sub->net = net; in tipc_sub_subscribe()
154 sub->conid = conid; in tipc_sub_subscribe()
155 sub->inactive = false; in tipc_sub_subscribe()
156 memcpy(&sub->evt.s, s, sizeof(*s)); in tipc_sub_subscribe()
157 sub->s.seq.type = tipc_sub_read(s, seq.type); in tipc_sub_subscribe()
158 sub->s.seq.lower = lower; in tipc_sub_subscribe()
159 sub->s.seq.upper = upper; in tipc_sub_subscribe()
160 sub->s.filter = filter; in tipc_sub_subscribe()
161 sub->s.timeout = tipc_sub_read(s, timeout); in tipc_sub_subscribe()
162 memcpy(sub->s.usr_handle, s->usr_handle, 8); in tipc_sub_subscribe()
163 spin_lock_init(&sub->lock); in tipc_sub_subscribe()
164 kref_init(&sub->kref); in tipc_sub_subscribe()
169 timer_setup(&sub->timer, tipc_sub_timeout, 0); in tipc_sub_subscribe()
170 timeout = tipc_sub_read(&sub->evt.s, timeout); in tipc_sub_subscribe()
172 mod_timer(&sub->timer, jiffies + msecs_to_jiffies(timeout)); in tipc_sub_subscribe()
179 if (sub->evt.s.timeout != TIPC_WAIT_FOREVER) in tipc_sub_unsubscribe()
180 del_timer_sync(&sub->timer); in tipc_sub_unsubscribe()
181 list_del(&sub->sub_list); in tipc_sub_unsubscribe()