Lines Matching refs:nseq
156 struct name_seq *nseq = kzalloc(sizeof(*nseq), GFP_ATOMIC); in tipc_nameseq_create() local
159 if (!nseq || !sseq) { in tipc_nameseq_create()
161 kfree(nseq); in tipc_nameseq_create()
166 spin_lock_init(&nseq->lock); in tipc_nameseq_create()
167 nseq->type = type; in tipc_nameseq_create()
168 nseq->sseqs = sseq; in tipc_nameseq_create()
169 nseq->alloc = 1; in tipc_nameseq_create()
170 INIT_HLIST_NODE(&nseq->ns_list); in tipc_nameseq_create()
171 INIT_LIST_HEAD(&nseq->subscriptions); in tipc_nameseq_create()
172 hlist_add_head_rcu(&nseq->ns_list, seq_head); in tipc_nameseq_create()
173 return nseq; in tipc_nameseq_create()
181 static struct sub_seq *nameseq_find_subseq(struct name_seq *nseq, in nameseq_find_subseq() argument
184 struct sub_seq *sseqs = nseq->sseqs; in nameseq_find_subseq()
186 int high = nseq->first_free - 1; in nameseq_find_subseq()
210 static u32 nameseq_locate_subseq(struct name_seq *nseq, u32 instance) in nameseq_locate_subseq() argument
212 struct sub_seq *sseqs = nseq->sseqs; in nameseq_locate_subseq()
214 int high = nseq->first_free - 1; in nameseq_locate_subseq()
233 struct name_seq *nseq, in tipc_nameseq_insert_publ() argument
245 sseq = nameseq_find_subseq(nseq, lower); in tipc_nameseq_insert_publ()
266 inspos = nameseq_locate_subseq(nseq, lower); in tipc_nameseq_insert_publ()
269 if ((inspos < nseq->first_free) && in tipc_nameseq_insert_publ()
270 (upper >= nseq->sseqs[inspos].lower)) { in tipc_nameseq_insert_publ()
275 if (nseq->first_free == nseq->alloc) { in tipc_nameseq_insert_publ()
276 struct sub_seq *sseqs = tipc_subseq_alloc(nseq->alloc * 2); in tipc_nameseq_insert_publ()
283 memcpy(sseqs, nseq->sseqs, in tipc_nameseq_insert_publ()
284 nseq->alloc * sizeof(struct sub_seq)); in tipc_nameseq_insert_publ()
285 kfree(nseq->sseqs); in tipc_nameseq_insert_publ()
286 nseq->sseqs = sseqs; in tipc_nameseq_insert_publ()
287 nseq->alloc *= 2; in tipc_nameseq_insert_publ()
302 sseq = &nseq->sseqs[inspos]; in tipc_nameseq_insert_publ()
303 freesseq = &nseq->sseqs[nseq->first_free]; in tipc_nameseq_insert_publ()
306 nseq->first_free++; in tipc_nameseq_insert_publ()
332 list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) { in tipc_nameseq_insert_publ()
352 struct name_seq *nseq, in tipc_nameseq_remove_publ() argument
357 struct sub_seq *sseq = nameseq_find_subseq(nseq, inst); in tipc_nameseq_remove_publ()
396 free = &nseq->sseqs[nseq->first_free--]; in tipc_nameseq_remove_publ()
402 list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) { in tipc_nameseq_remove_publ()
416 static void tipc_nameseq_subscribe(struct name_seq *nseq, in tipc_nameseq_subscribe() argument
419 struct sub_seq *sseq = nseq->sseqs; in tipc_nameseq_subscribe()
421 list_add(&s->nameseq_list, &nseq->subscriptions); in tipc_nameseq_subscribe()
426 while (sseq != &nseq->sseqs[nseq->first_free]) { in tipc_nameseq_subscribe()