Lines Matching refs:fqdir

156 	struct fqdir *fqdir, *tmp;  in fqdir_free_fn()  local
168 llist_for_each_entry_safe(fqdir, tmp, kill_list, free_list) { in fqdir_free_fn()
169 f = fqdir->f; in fqdir_free_fn()
173 kfree(fqdir); in fqdir_free_fn()
181 struct fqdir *fqdir = container_of(work, struct fqdir, destroy_work); in fqdir_work_fn() local
183 rhashtable_free_and_destroy(&fqdir->rhashtable, inet_frags_free_cb, NULL); in fqdir_work_fn()
185 if (llist_add(&fqdir->free_list, &fqdir_free_list)) in fqdir_work_fn()
189 int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net) in fqdir_init()
191 struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL); in fqdir_init() local
194 if (!fqdir) in fqdir_init()
196 fqdir->f = f; in fqdir_init()
197 fqdir->net = net; in fqdir_init()
198 res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params); in fqdir_init()
200 kfree(fqdir); in fqdir_init()
204 *fqdirp = fqdir; in fqdir_init()
221 void fqdir_exit(struct fqdir *fqdir) in fqdir_exit() argument
223 INIT_WORK(&fqdir->destroy_work, fqdir_work_fn); in fqdir_exit()
224 queue_work(inet_frag_wq, &fqdir->destroy_work); in fqdir_exit()
234 struct fqdir *fqdir = fq->fqdir; in inet_frag_kill() local
243 if (!READ_ONCE(fqdir->dead)) { in inet_frag_kill()
244 rhashtable_remove_fast(&fqdir->rhashtable, &fq->node, in inet_frag_kill()
245 fqdir->f->rhash_params); in inet_frag_kill()
259 struct inet_frags *f = q->fqdir->f; in inet_frag_destroy_rcu()
294 struct fqdir *fqdir; in inet_frag_destroy() local
303 fqdir = q->fqdir; in inet_frag_destroy()
304 f = fqdir->f; in inet_frag_destroy()
310 sub_frag_mem_limit(fqdir, sum); in inet_frag_destroy()
314 static struct inet_frag_queue *inet_frag_alloc(struct fqdir *fqdir, in inet_frag_alloc() argument
324 q->fqdir = fqdir; in inet_frag_alloc()
326 add_frag_mem_limit(fqdir, f->qsize); in inet_frag_alloc()
336 static struct inet_frag_queue *inet_frag_create(struct fqdir *fqdir, in inet_frag_create() argument
340 struct inet_frags *f = fqdir->f; in inet_frag_create()
343 q = inet_frag_alloc(fqdir, f, arg); in inet_frag_create()
348 mod_timer(&q->timer, jiffies + fqdir->timeout); in inet_frag_create()
350 *prev = rhashtable_lookup_get_insert_key(&fqdir->rhashtable, &q->key, in inet_frag_create()
367 struct inet_frag_queue *inet_frag_find(struct fqdir *fqdir, void *key) in inet_frag_find() argument
370 long high_thresh = READ_ONCE(fqdir->high_thresh); in inet_frag_find()
373 if (!high_thresh || frag_mem_limit(fqdir) > high_thresh) in inet_frag_find()
376 prev = rhashtable_lookup(&fqdir->rhashtable, key, fqdir->f->rhash_params); in inet_frag_find()
378 fq = inet_frag_create(fqdir, key, &prev); in inet_frag_find()
506 add_frag_mem_limit(q->fqdir, delta); in inet_frag_reasm_prepare()
528 add_frag_mem_limit(q->fqdir, clone->truesize); in inet_frag_reasm_prepare()
615 sub_frag_mem_limit(q->fqdir, sum_truesize); in inet_frag_reasm_finish()
647 sub_frag_mem_limit(q->fqdir, head->truesize); in inet_frag_pull_head()