Lines Matching refs:objagg_hints
15 struct objagg_hints { struct
35 objagg_hints_lookup(struct objagg_hints *objagg_hints, void *obj) in objagg_hints_lookup() argument
37 if (!objagg_hints) in objagg_hints_lookup()
39 return rhashtable_lookup_fast(&objagg_hints->node_ht, obj, in objagg_hints_lookup()
40 objagg_hints->ht_params); in objagg_hints_lookup()
51 struct objagg_hints *hints;
515 struct objagg_hints *objagg_hints, void *priv) in objagg_create() argument
529 if (objagg_hints) { in objagg_create()
530 objagg->hints = objagg_hints; in objagg_create()
531 objagg_hints->refcount++; in objagg_create()
649 objagg_hints_node_create(struct objagg_hints *objagg_hints, in objagg_hints_node_create() argument
666 hnode->root_id = objagg_hints->root_count++; in objagg_hints_node_create()
671 err = rhashtable_insert_fast(&objagg_hints->node_ht, &hnode->ht_node, in objagg_hints_node_create()
672 objagg_hints->ht_params); in objagg_hints_node_create()
676 list_add(&hnode->list, &objagg_hints->node_list); in objagg_hints_node_create()
678 objagg_hints->node_count++; in objagg_hints_node_create()
687 static void objagg_hints_flush(struct objagg_hints *objagg_hints) in objagg_hints_flush() argument
691 list_for_each_entry_safe(hnode, tmp, &objagg_hints->node_list, list) { in objagg_hints_flush()
693 rhashtable_remove_fast(&objagg_hints->node_ht, &hnode->ht_node, in objagg_hints_flush()
694 objagg_hints->ht_params); in objagg_hints_flush()
839 objagg_opt_simple_greedy_fillup_hints(struct objagg_hints *objagg_hints, in objagg_opt_simple_greedy_fillup_hints() argument
859 hnode = objagg_hints_node_create(objagg_hints, in objagg_opt_simple_greedy_fillup_hints()
875 hnode = objagg_hints_node_create(objagg_hints, in objagg_opt_simple_greedy_fillup_hints()
893 int (*fillup_hints)(struct objagg_hints *objagg_hints,
910 struct objagg_hints *objagg_hints = in objagg_hints_obj_cmp() local
911 container_of(ht, struct objagg_hints, node_ht); in objagg_hints_obj_cmp()
912 const struct objagg_ops *ops = objagg_hints->ops; in objagg_hints_obj_cmp()
937 struct objagg_hints *objagg_hints_get(struct objagg *objagg, in objagg_hints_get()
941 struct objagg_hints *objagg_hints; in objagg_hints_get() local
944 objagg_hints = kzalloc(sizeof(*objagg_hints), GFP_KERNEL); in objagg_hints_get()
945 if (!objagg_hints) in objagg_hints_get()
948 objagg_hints->ops = objagg->ops; in objagg_hints_get()
949 objagg_hints->refcount = 1; in objagg_hints_get()
951 INIT_LIST_HEAD(&objagg_hints->node_list); in objagg_hints_get()
953 objagg_hints->ht_params.key_len = objagg->ops->obj_size; in objagg_hints_get()
954 objagg_hints->ht_params.key_offset = in objagg_hints_get()
956 objagg_hints->ht_params.head_offset = in objagg_hints_get()
958 objagg_hints->ht_params.obj_cmpfn = objagg_hints_obj_cmp; in objagg_hints_get()
960 err = rhashtable_init(&objagg_hints->node_ht, &objagg_hints->ht_params); in objagg_hints_get()
964 err = algo->fillup_hints(objagg_hints, objagg); in objagg_hints_get()
968 if (WARN_ON(objagg_hints->node_count != objagg->obj_count)) { in objagg_hints_get()
973 return objagg_hints; in objagg_hints_get()
977 objagg_hints_flush(objagg_hints); in objagg_hints_get()
978 rhashtable_destroy(&objagg_hints->node_ht); in objagg_hints_get()
980 kfree(objagg_hints); in objagg_hints_get()
991 void objagg_hints_put(struct objagg_hints *objagg_hints) in objagg_hints_put() argument
993 if (--objagg_hints->refcount) in objagg_hints_put()
995 objagg_hints_flush(objagg_hints); in objagg_hints_put()
996 rhashtable_destroy(&objagg_hints->node_ht); in objagg_hints_put()
997 kfree(objagg_hints); in objagg_hints_put()
1019 objagg_hints_stats_get(struct objagg_hints *objagg_hints) in objagg_hints_stats_get() argument
1026 objagg_hints->node_count), in objagg_hints_stats_get()
1032 list_for_each_entry(hnode, &objagg_hints->node_list, list) { in objagg_hints_stats_get()