Lines Matching refs:fqdir

153 	struct fqdir *fqdir, *tmp;  in fqdir_free_fn()  local
165 llist_for_each_entry_safe(fqdir, tmp, kill_list, free_list) { in fqdir_free_fn()
166 f = fqdir->f; in fqdir_free_fn()
170 kfree(fqdir); in fqdir_free_fn()
178 struct fqdir *fqdir = container_of(work, struct fqdir, destroy_work); in fqdir_work_fn() local
180 rhashtable_free_and_destroy(&fqdir->rhashtable, inet_frags_free_cb, NULL); in fqdir_work_fn()
182 if (llist_add(&fqdir->free_list, &fqdir_free_list)) in fqdir_work_fn()
186 int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net) in fqdir_init()
188 struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL); in fqdir_init() local
191 if (!fqdir) in fqdir_init()
193 fqdir->f = f; in fqdir_init()
194 fqdir->net = net; in fqdir_init()
195 res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params); in fqdir_init()
197 kfree(fqdir); in fqdir_init()
201 *fqdirp = fqdir; in fqdir_init()
218 void fqdir_exit(struct fqdir *fqdir) in fqdir_exit() argument
220 INIT_WORK(&fqdir->destroy_work, fqdir_work_fn); in fqdir_exit()
221 queue_work(inet_frag_wq, &fqdir->destroy_work); in fqdir_exit()
231 struct fqdir *fqdir = fq->fqdir; in inet_frag_kill() local
240 if (!READ_ONCE(fqdir->dead)) { in inet_frag_kill()
241 rhashtable_remove_fast(&fqdir->rhashtable, &fq->node, in inet_frag_kill()
242 fqdir->f->rhash_params); in inet_frag_kill()
256 struct inet_frags *f = q->fqdir->f; in inet_frag_destroy_rcu()
287 struct fqdir *fqdir; in inet_frag_destroy() local
295 fqdir = q->fqdir; in inet_frag_destroy()
296 f = fqdir->f; in inet_frag_destroy()
302 sub_frag_mem_limit(fqdir, sum); in inet_frag_destroy()
306 static struct inet_frag_queue *inet_frag_alloc(struct fqdir *fqdir, in inet_frag_alloc() argument
316 q->fqdir = fqdir; in inet_frag_alloc()
318 add_frag_mem_limit(fqdir, f->qsize); in inet_frag_alloc()
327 static struct inet_frag_queue *inet_frag_create(struct fqdir *fqdir, in inet_frag_create() argument
331 struct inet_frags *f = fqdir->f; in inet_frag_create()
334 q = inet_frag_alloc(fqdir, f, arg); in inet_frag_create()
339 mod_timer(&q->timer, jiffies + fqdir->timeout); in inet_frag_create()
341 *prev = rhashtable_lookup_get_insert_key(&fqdir->rhashtable, &q->key, in inet_frag_create()
353 struct inet_frag_queue *inet_frag_find(struct fqdir *fqdir, void *key) in inet_frag_find() argument
356 long high_thresh = READ_ONCE(fqdir->high_thresh); in inet_frag_find()
359 if (!high_thresh || frag_mem_limit(fqdir) > high_thresh) in inet_frag_find()
364 prev = rhashtable_lookup(&fqdir->rhashtable, key, fqdir->f->rhash_params); in inet_frag_find()
366 fq = inet_frag_create(fqdir, key, &prev); in inet_frag_find()
477 add_frag_mem_limit(q->fqdir, delta); in inet_frag_reasm_prepare()
499 add_frag_mem_limit(q->fqdir, clone->truesize); in inet_frag_reasm_prepare()
569 sub_frag_mem_limit(q->fqdir, sum_truesize); in inet_frag_reasm_finish()
598 sub_frag_mem_limit(q->fqdir, head->truesize); in inet_frag_pull_head()