Lines Matching refs:fqdir

154 	struct fqdir *fqdir, *tmp;  in fqdir_free_fn()  local
166 llist_for_each_entry_safe(fqdir, tmp, kill_list, free_list) { in fqdir_free_fn()
167 f = fqdir->f; in fqdir_free_fn()
171 kfree(fqdir); in fqdir_free_fn()
179 struct fqdir *fqdir = container_of(work, struct fqdir, destroy_work); in fqdir_work_fn() local
181 rhashtable_free_and_destroy(&fqdir->rhashtable, inet_frags_free_cb, NULL); in fqdir_work_fn()
183 if (llist_add(&fqdir->free_list, &fqdir_free_list)) in fqdir_work_fn()
187 int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net) in fqdir_init()
189 struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL); in fqdir_init() local
192 if (!fqdir) in fqdir_init()
194 fqdir->f = f; in fqdir_init()
195 fqdir->net = net; in fqdir_init()
196 res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params); in fqdir_init()
198 kfree(fqdir); in fqdir_init()
202 *fqdirp = fqdir; in fqdir_init()
219 void fqdir_exit(struct fqdir *fqdir) in fqdir_exit() argument
221 INIT_WORK(&fqdir->destroy_work, fqdir_work_fn); in fqdir_exit()
222 queue_work(inet_frag_wq, &fqdir->destroy_work); in fqdir_exit()
232 struct fqdir *fqdir = fq->fqdir; in inet_frag_kill() local
241 if (!READ_ONCE(fqdir->dead)) { in inet_frag_kill()
242 rhashtable_remove_fast(&fqdir->rhashtable, &fq->node, in inet_frag_kill()
243 fqdir->f->rhash_params); in inet_frag_kill()
257 struct inet_frags *f = q->fqdir->f; in inet_frag_destroy_rcu()
292 struct fqdir *fqdir; in inet_frag_destroy() local
301 fqdir = q->fqdir; in inet_frag_destroy()
302 f = fqdir->f; in inet_frag_destroy()
308 sub_frag_mem_limit(fqdir, sum); in inet_frag_destroy()
312 static struct inet_frag_queue *inet_frag_alloc(struct fqdir *fqdir, in inet_frag_alloc() argument
322 q->fqdir = fqdir; in inet_frag_alloc()
324 add_frag_mem_limit(fqdir, f->qsize); in inet_frag_alloc()
333 static struct inet_frag_queue *inet_frag_create(struct fqdir *fqdir, in inet_frag_create() argument
337 struct inet_frags *f = fqdir->f; in inet_frag_create()
340 q = inet_frag_alloc(fqdir, f, arg); in inet_frag_create()
345 mod_timer(&q->timer, jiffies + fqdir->timeout); in inet_frag_create()
347 *prev = rhashtable_lookup_get_insert_key(&fqdir->rhashtable, &q->key, in inet_frag_create()
359 struct inet_frag_queue *inet_frag_find(struct fqdir *fqdir, void *key) in inet_frag_find() argument
362 long high_thresh = READ_ONCE(fqdir->high_thresh); in inet_frag_find()
365 if (!high_thresh || frag_mem_limit(fqdir) > high_thresh) in inet_frag_find()
370 prev = rhashtable_lookup(&fqdir->rhashtable, key, fqdir->f->rhash_params); in inet_frag_find()
372 fq = inet_frag_create(fqdir, key, &prev); in inet_frag_find()
483 add_frag_mem_limit(q->fqdir, delta); in inet_frag_reasm_prepare()
505 add_frag_mem_limit(q->fqdir, clone->truesize); in inet_frag_reasm_prepare()
575 sub_frag_mem_limit(q->fqdir, sum_truesize); in inet_frag_reasm_finish()
604 sub_frag_mem_limit(q->fqdir, head->truesize); in inet_frag_pull_head()