Lines Matching defs:nseq
167 struct name_seq *nseq = kzalloc(sizeof(*nseq), GFP_ATOMIC);
170 if (!nseq || !sseq) {
172 kfree(nseq);
177 spin_lock_init(&nseq->lock);
178 nseq->type = type;
179 nseq->sseqs = sseq;
180 dbg("tipc_nameseq_create(): nseq = %p, type %u, ssseqs %p, ff: %u\n",
181 nseq, type, nseq->sseqs, nseq->first_free);
182 nseq->alloc = 1;
183 INIT_HLIST_NODE(&nseq->ns_list);
184 INIT_LIST_HEAD(&nseq->subscriptions);
185 hlist_add_head(&nseq->ns_list, seq_head);
186 return nseq;
195 static struct sub_seq *nameseq_find_subseq(struct name_seq *nseq,
198 struct sub_seq *sseqs = nseq->sseqs;
200 int high = nseq->first_free - 1;
225 static u32 nameseq_locate_subseq(struct name_seq *nseq, u32 instance)
227 struct sub_seq *sseqs = nseq->sseqs;
229 int high = nseq->first_free - 1;
248 static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
258 sseq = nameseq_find_subseq(nseq, lower);
260 nseq, type, lower, sseq);
276 inspos = nameseq_locate_subseq(nseq, lower);
280 if ((inspos < nseq->first_free) &&
281 (upper >= nseq->sseqs[inspos].lower)) {
289 if (nseq->first_free == nseq->alloc) {
290 struct sub_seq *sseqs = tipc_subseq_alloc(nseq->alloc * 2);
297 dbg("Allocated %u more sseqs\n", nseq->alloc);
298 memcpy(sseqs, nseq->sseqs,
299 nseq->alloc * sizeof(struct sub_seq));
300 kfree(nseq->sseqs);
301 nseq->sseqs = sseqs;
302 nseq->alloc *= 2;
304 dbg("Have %u sseqs for type %u\n", nseq->alloc, type);
308 dbg("ins in pos %u, ff = %u\n", inspos, nseq->first_free);
309 sseq = &nseq->sseqs[inspos];
310 freesseq = &nseq->sseqs[nseq->first_free];
313 nseq->first_free++;
320 sseq->lower, sseq->upper, nseq);
362 list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) {
387 static struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst,
393 struct sub_seq *sseq = nameseq_find_subseq(nseq, inst);
402 nseq, sseq, nseq->type, inst, key);
494 free = &nseq->sseqs[nseq->first_free--];
501 list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) {
520 static void tipc_nameseq_subscribe(struct name_seq *nseq, struct subscription *s)
522 struct sub_seq *sseq = nseq->sseqs;
524 list_add(&s->nameseq_list, &nseq->subscriptions);
529 while (sseq != &nseq->sseqs[nseq->first_free]) {