Lines Matching refs:inst

73 static void crypto_free_instance(struct crypto_instance *inst)  in crypto_free_instance()  argument
75 inst->alg.cra_type->free(inst); in crypto_free_instance()
80 struct crypto_instance *inst = container_of(w, struct crypto_instance, in crypto_destroy_instance_workfn() local
82 struct crypto_template *tmpl = inst->tmpl; in crypto_destroy_instance_workfn()
84 crypto_free_instance(inst); in crypto_destroy_instance_workfn()
90 struct crypto_instance *inst = container_of(alg, in crypto_destroy_instance() local
94 INIT_WORK(&inst->free_work, crypto_destroy_instance_workfn); in crypto_destroy_instance()
95 schedule_work(&inst->free_work); in crypto_destroy_instance()
128 return &n->inst->alg.cra_users; in crypto_more_spawns()
131 static void crypto_remove_instance(struct crypto_instance *inst, in crypto_remove_instance() argument
134 struct crypto_template *tmpl = inst->tmpl; in crypto_remove_instance()
136 if (crypto_is_dead(&inst->alg)) in crypto_remove_instance()
139 inst->alg.cra_flags |= CRYPTO_ALG_DEAD; in crypto_remove_instance()
144 list_move(&inst->alg.cra_list, list); in crypto_remove_instance()
145 hlist_del(&inst->list); in crypto_remove_instance()
146 inst->alg.cra_destroy = crypto_destroy_instance; in crypto_remove_instance()
148 BUG_ON(!list_empty(&inst->alg.cra_users)); in crypto_remove_instance()
183 struct crypto_instance *inst; in crypto_remove_spawns() local
187 inst = spawn->inst; in crypto_remove_spawns()
190 spawn->dead = !spawn->registered || &inst->alg != nalg; in crypto_remove_spawns()
195 BUG_ON(&inst->alg == alg); in crypto_remove_spawns()
197 if (&inst->alg == nalg) in crypto_remove_spawns()
200 spawns = &inst->alg.cra_users; in crypto_remove_spawns()
232 crypto_remove_instance(spawn->inst, list); in crypto_remove_spawns()
588 struct crypto_instance *inst; in crypto_unregister_template() local
599 hlist_for_each_entry(inst, list, list) { in crypto_unregister_template()
600 int err = crypto_remove_alg(&inst->alg, &users); in crypto_unregister_template()
607 hlist_for_each_entry_safe(inst, n, list, list) { in crypto_unregister_template()
608 BUG_ON(refcount_read(&inst->alg.cra_refcnt) != 1); in crypto_unregister_template()
609 crypto_free_instance(inst); in crypto_unregister_template()
651 struct crypto_instance *inst) in crypto_register_instance() argument
659 err = crypto_check_alg(&inst->alg); in crypto_register_instance()
663 inst->alg.cra_module = tmpl->module; in crypto_register_instance()
664 inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE; in crypto_register_instance()
669 for (spawn = inst->spawns; spawn;) { in crypto_register_instance()
676 spawn->inst = inst; in crypto_register_instance()
686 inst->alg.cra_flags |= (fips_internal & CRYPTO_ALG_FIPS_INTERNAL); in crypto_register_instance()
688 larval = __crypto_register_alg(&inst->alg, &algs_to_put); in crypto_register_instance()
694 hlist_add_head(&inst->list, &tmpl->instances); in crypto_register_instance()
695 inst->tmpl = tmpl; in crypto_register_instance()
709 void crypto_unregister_instance(struct crypto_instance *inst) in crypto_unregister_instance() argument
715 crypto_remove_spawns(&inst->alg, &list, NULL); in crypto_unregister_instance()
716 crypto_remove_instance(inst, &list); in crypto_unregister_instance()
724 int crypto_grab_spawn(struct crypto_spawn *spawn, struct crypto_instance *inst, in crypto_grab_spawn() argument
730 if (WARN_ON_ONCE(inst == NULL)) in crypto_grab_spawn()
747 spawn->next = inst->spawns; in crypto_grab_spawn()
748 inst->spawns = spawn; in crypto_grab_spawn()
749 inst->alg.cra_flags |= in crypto_grab_spawn()
927 int crypto_inst_setname(struct crypto_instance *inst, const char *name, in crypto_inst_setname() argument
930 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", name, in crypto_inst_setname()
934 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", in crypto_inst_setname()