diff options
Diffstat (limited to 'net/tipc/subscr.c')
-rw-r--r-- | net/tipc/subscr.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index 8d37b61e3163..3be1e4b6cbfa 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
@@ -38,9 +38,9 @@ | |||
38 | #include "name_table.h" | 38 | #include "name_table.h" |
39 | #include "subscr.h" | 39 | #include "subscr.h" |
40 | 40 | ||
41 | static void tipc_subscrp_send_event(struct tipc_subscription *sub, | 41 | static void tipc_sub_send_event(struct tipc_subscription *sub, |
42 | u32 found_lower, u32 found_upper, | 42 | u32 found_lower, u32 found_upper, |
43 | u32 event, u32 port, u32 node) | 43 | u32 event, u32 port, u32 node) |
44 | { | 44 | { |
45 | struct tipc_event *evt = &sub->evt; | 45 | struct tipc_event *evt = &sub->evt; |
46 | 46 | ||
@@ -55,13 +55,13 @@ static void tipc_subscrp_send_event(struct tipc_subscription *sub, | |||
55 | } | 55 | } |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * tipc_subscrp_check_overlap - test for subscription overlap with the | 58 | * tipc_sub_check_overlap - test for subscription overlap with the |
59 | * given values | 59 | * given values |
60 | * | 60 | * |
61 | * Returns 1 if there is overlap, otherwise 0. | 61 | * Returns 1 if there is overlap, otherwise 0. |
62 | */ | 62 | */ |
63 | int tipc_subscrp_check_overlap(struct tipc_name_seq *seq, u32 found_lower, | 63 | int tipc_sub_check_overlap(struct tipc_name_seq *seq, u32 found_lower, |
64 | u32 found_upper) | 64 | u32 found_upper) |
65 | { | 65 | { |
66 | if (found_lower < seq->lower) | 66 | if (found_lower < seq->lower) |
67 | found_lower = seq->lower; | 67 | found_lower = seq->lower; |
@@ -72,20 +72,20 @@ int tipc_subscrp_check_overlap(struct tipc_name_seq *seq, u32 found_lower, | |||
72 | return 1; | 72 | return 1; |
73 | } | 73 | } |
74 | 74 | ||
75 | void tipc_subscrp_report_overlap(struct tipc_subscription *sub, | 75 | void tipc_sub_report_overlap(struct tipc_subscription *sub, |
76 | u32 found_lower, u32 found_upper, | 76 | u32 found_lower, u32 found_upper, |
77 | u32 event, u32 port, u32 node, | 77 | u32 event, u32 port, u32 node, |
78 | u32 scope, int must) | 78 | u32 scope, int must) |
79 | { | 79 | { |
80 | struct tipc_name_seq seq; | ||
81 | struct tipc_subscr *s = &sub->evt.s; | 80 | struct tipc_subscr *s = &sub->evt.s; |
82 | u32 filter = tipc_sub_read(s, filter); | 81 | u32 filter = tipc_sub_read(s, filter); |
82 | struct tipc_name_seq seq; | ||
83 | 83 | ||
84 | seq.type = tipc_sub_read(s, seq.type); | 84 | seq.type = tipc_sub_read(s, seq.type); |
85 | seq.lower = tipc_sub_read(s, seq.lower); | 85 | seq.lower = tipc_sub_read(s, seq.lower); |
86 | seq.upper = tipc_sub_read(s, seq.upper); | 86 | seq.upper = tipc_sub_read(s, seq.upper); |
87 | 87 | ||
88 | if (!tipc_subscrp_check_overlap(&seq, found_lower, found_upper)) | 88 | if (!tipc_sub_check_overlap(&seq, found_lower, found_upper)) |
89 | return; | 89 | return; |
90 | 90 | ||
91 | if (!must && !(filter & TIPC_SUB_PORTS)) | 91 | if (!must && !(filter & TIPC_SUB_PORTS)) |
@@ -95,24 +95,24 @@ void tipc_subscrp_report_overlap(struct tipc_subscription *sub, | |||
95 | if (filter & TIPC_SUB_NODE_SCOPE && scope != TIPC_NODE_SCOPE) | 95 | if (filter & TIPC_SUB_NODE_SCOPE && scope != TIPC_NODE_SCOPE) |
96 | return; | 96 | return; |
97 | spin_lock(&sub->lock); | 97 | spin_lock(&sub->lock); |
98 | tipc_subscrp_send_event(sub, found_lower, found_upper, | 98 | tipc_sub_send_event(sub, found_lower, found_upper, |
99 | event, port, node); | 99 | event, port, node); |
100 | spin_unlock(&sub->lock); | 100 | spin_unlock(&sub->lock); |
101 | } | 101 | } |
102 | 102 | ||
103 | static void tipc_subscrp_timeout(struct timer_list *t) | 103 | static void tipc_sub_timeout(struct timer_list *t) |
104 | { | 104 | { |
105 | struct tipc_subscription *sub = from_timer(sub, t, timer); | 105 | struct tipc_subscription *sub = from_timer(sub, t, timer); |
106 | struct tipc_subscr *s = &sub->evt.s; | 106 | struct tipc_subscr *s = &sub->evt.s; |
107 | 107 | ||
108 | spin_lock(&sub->lock); | 108 | spin_lock(&sub->lock); |
109 | tipc_subscrp_send_event(sub, s->seq.lower, s->seq.upper, | 109 | tipc_sub_send_event(sub, s->seq.lower, s->seq.upper, |
110 | TIPC_SUBSCR_TIMEOUT, 0, 0); | 110 | TIPC_SUBSCR_TIMEOUT, 0, 0); |
111 | sub->inactive = true; | 111 | sub->inactive = true; |
112 | spin_unlock(&sub->lock); | 112 | spin_unlock(&sub->lock); |
113 | } | 113 | } |
114 | 114 | ||
115 | static void tipc_subscrp_kref_release(struct kref *kref) | 115 | static void tipc_sub_kref_release(struct kref *kref) |
116 | { | 116 | { |
117 | struct tipc_subscription *sub; | 117 | struct tipc_subscription *sub; |
118 | struct tipc_net *tn; | 118 | struct tipc_net *tn; |
@@ -124,12 +124,12 @@ static void tipc_subscrp_kref_release(struct kref *kref) | |||
124 | kfree(sub); | 124 | kfree(sub); |
125 | } | 125 | } |
126 | 126 | ||
127 | void tipc_subscrp_put(struct tipc_subscription *subscription) | 127 | void tipc_sub_put(struct tipc_subscription *subscription) |
128 | { | 128 | { |
129 | kref_put(&subscription->kref, tipc_subscrp_kref_release); | 129 | kref_put(&subscription->kref, tipc_sub_kref_release); |
130 | } | 130 | } |
131 | 131 | ||
132 | void tipc_subscrp_get(struct tipc_subscription *subscription) | 132 | void tipc_sub_get(struct tipc_subscription *subscription) |
133 | { | 133 | { |
134 | kref_get(&subscription->kref); | 134 | kref_get(&subscription->kref); |
135 | } | 135 | } |
@@ -139,8 +139,8 @@ struct tipc_subscription *tipc_sub_subscribe(struct tipc_server *srv, | |||
139 | int conid) | 139 | int conid) |
140 | { | 140 | { |
141 | struct tipc_net *tn = tipc_net(srv->net); | 141 | struct tipc_net *tn = tipc_net(srv->net); |
142 | struct tipc_subscription *sub; | ||
143 | u32 filter = tipc_sub_read(s, filter); | 142 | u32 filter = tipc_sub_read(s, filter); |
143 | struct tipc_subscription *sub; | ||
144 | u32 timeout; | 144 | u32 timeout; |
145 | 145 | ||
146 | if (atomic_read(&tn->subscription_count) >= TIPC_MAX_SUBSCR) { | 146 | if (atomic_read(&tn->subscription_count) >= TIPC_MAX_SUBSCR) { |
@@ -165,7 +165,7 @@ struct tipc_subscription *tipc_sub_subscribe(struct tipc_server *srv, | |||
165 | atomic_inc(&tn->subscription_count); | 165 | atomic_inc(&tn->subscription_count); |
166 | kref_init(&sub->kref); | 166 | kref_init(&sub->kref); |
167 | tipc_nametbl_subscribe(sub); | 167 | tipc_nametbl_subscribe(sub); |
168 | timer_setup(&sub->timer, tipc_subscrp_timeout, 0); | 168 | timer_setup(&sub->timer, tipc_sub_timeout, 0); |
169 | timeout = tipc_sub_read(&sub->evt.s, timeout); | 169 | timeout = tipc_sub_read(&sub->evt.s, timeout); |
170 | if (timeout != TIPC_WAIT_FOREVER) | 170 | if (timeout != TIPC_WAIT_FOREVER) |
171 | mod_timer(&sub->timer, jiffies + msecs_to_jiffies(timeout)); | 171 | mod_timer(&sub->timer, jiffies + msecs_to_jiffies(timeout)); |
@@ -177,16 +177,16 @@ void tipc_sub_unsubscribe(struct tipc_subscription *sub) | |||
177 | tipc_nametbl_unsubscribe(sub); | 177 | tipc_nametbl_unsubscribe(sub); |
178 | if (sub->evt.s.timeout != TIPC_WAIT_FOREVER) | 178 | if (sub->evt.s.timeout != TIPC_WAIT_FOREVER) |
179 | del_timer_sync(&sub->timer); | 179 | del_timer_sync(&sub->timer); |
180 | list_del(&sub->subscrp_list); | 180 | list_del(&sub->sub_list); |
181 | tipc_subscrp_put(sub); | 181 | tipc_sub_put(sub); |
182 | } | 182 | } |
183 | 183 | ||
184 | int tipc_topsrv_start(struct net *net) | 184 | int tipc_topsrv_start(struct net *net) |
185 | { | 185 | { |
186 | struct tipc_net *tn = net_generic(net, tipc_net_id); | 186 | struct tipc_net *tn = net_generic(net, tipc_net_id); |
187 | const char name[] = "topology_server"; | 187 | const char name[] = "topology_server"; |
188 | struct tipc_server *topsrv; | ||
189 | struct sockaddr_tipc *saddr; | 188 | struct sockaddr_tipc *saddr; |
189 | struct tipc_server *topsrv; | ||
190 | 190 | ||
191 | saddr = kzalloc(sizeof(*saddr), GFP_ATOMIC); | 191 | saddr = kzalloc(sizeof(*saddr), GFP_ATOMIC); |
192 | if (!saddr) | 192 | if (!saddr) |