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()
842 objagg_opt_simple_greedy_fillup_hints(struct objagg_hints *objagg_hints, in objagg_opt_simple_greedy_fillup_hints() argument
862 hnode = objagg_hints_node_create(objagg_hints, in objagg_opt_simple_greedy_fillup_hints()
878 hnode = objagg_hints_node_create(objagg_hints, in objagg_opt_simple_greedy_fillup_hints()
896 int (*fillup_hints)(struct objagg_hints *objagg_hints,
913 struct objagg_hints *objagg_hints = in objagg_hints_obj_cmp() local
914 container_of(ht, struct objagg_hints, node_ht); in objagg_hints_obj_cmp()
915 const struct objagg_ops *ops = objagg_hints->ops; in objagg_hints_obj_cmp()
940 struct objagg_hints *objagg_hints_get(struct objagg *objagg, in objagg_hints_get()
944 struct objagg_hints *objagg_hints; in objagg_hints_get() local
947 objagg_hints = kzalloc(sizeof(*objagg_hints), GFP_KERNEL); in objagg_hints_get()
948 if (!objagg_hints) in objagg_hints_get()
951 objagg_hints->ops = objagg->ops; in objagg_hints_get()
952 objagg_hints->refcount = 1; in objagg_hints_get()
954 INIT_LIST_HEAD(&objagg_hints->node_list); in objagg_hints_get()
956 objagg_hints->ht_params.key_len = objagg->ops->obj_size; in objagg_hints_get()
957 objagg_hints->ht_params.key_offset = in objagg_hints_get()
959 objagg_hints->ht_params.head_offset = in objagg_hints_get()
961 objagg_hints->ht_params.obj_cmpfn = objagg_hints_obj_cmp; in objagg_hints_get()
963 err = rhashtable_init(&objagg_hints->node_ht, &objagg_hints->ht_params); in objagg_hints_get()
967 err = algo->fillup_hints(objagg_hints, objagg); in objagg_hints_get()
971 if (WARN_ON(objagg_hints->node_count != objagg->obj_count)) { in objagg_hints_get()
976 return objagg_hints; in objagg_hints_get()
980 objagg_hints_flush(objagg_hints); in objagg_hints_get()
981 rhashtable_destroy(&objagg_hints->node_ht); in objagg_hints_get()
983 kfree(objagg_hints); in objagg_hints_get()
994 void objagg_hints_put(struct objagg_hints *objagg_hints) in objagg_hints_put() argument
996 if (--objagg_hints->refcount) in objagg_hints_put()
998 objagg_hints_flush(objagg_hints); in objagg_hints_put()
999 rhashtable_destroy(&objagg_hints->node_ht); in objagg_hints_put()
1000 kfree(objagg_hints); in objagg_hints_put()
1022 objagg_hints_stats_get(struct objagg_hints *objagg_hints) in objagg_hints_stats_get() argument
1029 objagg_hints->node_count), in objagg_hints_stats_get()
1035 list_for_each_entry(hnode, &objagg_hints->node_list, list) { in objagg_hints_stats_get()