Lines Matching refs:q
56 inet_frag_hashfn(const struct inet_frags *f, const struct inet_frag_queue *q) in inet_frag_hashfn() argument
58 return f->hashfn(q) & (INETFRAGS_HASHSZ - 1); in inet_frag_hashfn()
80 struct inet_frag_queue *q; in inet_frag_secret_rebuild() local
86 hlist_for_each_entry_safe(q, n, &hb->chain, list) { in inet_frag_secret_rebuild()
87 unsigned int hval = inet_frag_hashfn(f, q); in inet_frag_secret_rebuild()
92 hlist_del(&q->list); in inet_frag_secret_rebuild()
107 hlist_add_head(&q->list, &hb_dest->chain); in inet_frag_secret_rebuild()
120 static bool inet_fragq_should_evict(const struct inet_frag_queue *q) in inet_fragq_should_evict() argument
122 return q->net->low_thresh == 0 || in inet_fragq_should_evict()
123 frag_mem_limit(q->net) >= q->net->low_thresh; in inet_fragq_should_evict()
313 void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f) in inet_frag_destroy() argument
319 WARN_ON(!(q->flags & INET_FRAG_COMPLETE)); in inet_frag_destroy()
320 WARN_ON(del_timer(&q->timer) != 0); in inet_frag_destroy()
323 fp = q->fragments; in inet_frag_destroy()
324 nf = q->net; in inet_frag_destroy()
333 sub_frag_mem_limit(q, sum); in inet_frag_destroy()
336 f->destructor(q); in inet_frag_destroy()
337 kmem_cache_free(f->frags_cachep, q); in inet_frag_destroy()
380 struct inet_frag_queue *q; in inet_frag_alloc() local
387 q = kmem_cache_zalloc(f->frags_cachep, GFP_ATOMIC); in inet_frag_alloc()
388 if (q == NULL) in inet_frag_alloc()
391 q->net = nf; in inet_frag_alloc()
392 f->constructor(q, arg); in inet_frag_alloc()
393 add_frag_mem_limit(q, f->qsize); in inet_frag_alloc()
395 setup_timer(&q->timer, f->frag_expire, (unsigned long)q); in inet_frag_alloc()
396 spin_lock_init(&q->lock); in inet_frag_alloc()
397 atomic_set(&q->refcnt, 1); in inet_frag_alloc()
399 return q; in inet_frag_alloc()
406 struct inet_frag_queue *q; in inet_frag_create() local
408 q = inet_frag_alloc(nf, f, arg); in inet_frag_create()
409 if (q == NULL) in inet_frag_create()
412 return inet_frag_intern(nf, q, f, arg); in inet_frag_create()
420 struct inet_frag_queue *q; in inet_frag_find() local
430 hlist_for_each_entry(q, &hb->chain, list) { in inet_frag_find()
431 if (q->net == nf && f->match(q, key)) { in inet_frag_find()
432 atomic_inc(&q->refcnt); in inet_frag_find()
434 return q; in inet_frag_find()
453 void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, in inet_frag_maybe_warn_overflow() argument
460 if (PTR_ERR(q) == -ENOBUFS) in inet_frag_maybe_warn_overflow()