Source
static unsigned int objagg_tmp_graph_node_weight(struct objagg_tmp_graph *graph,
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2018 Mellanox Technologies. All rights reserved */
struct objagg_hints {
struct rhashtable node_ht;
struct rhashtable_params ht_params;
struct list_head node_list;
unsigned int node_count;
unsigned int root_count;
unsigned int refcount;
const struct objagg_ops *ops;
};
struct objagg_hints_node {
struct rhash_head ht_node; /* member of objagg_hints->node_ht */
struct list_head list; /* member of objagg_hints->node_list */
struct objagg_hints_node *parent;
unsigned int root_id;
struct objagg_obj_stats_info stats_info;
unsigned long obj[0];
};
static struct objagg_hints_node *
objagg_hints_lookup(struct objagg_hints *objagg_hints, void *obj)
{
if (!objagg_hints)
return NULL;
return rhashtable_lookup_fast(&objagg_hints->node_ht, obj,
objagg_hints->ht_params);
}
struct objagg {
const struct objagg_ops *ops;
void *priv;
struct rhashtable obj_ht;
struct rhashtable_params ht_params;
struct list_head obj_list;
unsigned int obj_count;
struct ida root_ida;
struct objagg_hints *hints;
};
struct objagg_obj {
struct rhash_head ht_node; /* member of objagg->obj_ht */
struct list_head list; /* member of objagg->obj_list */
struct objagg_obj *parent; /* if the object is nested, this
* holds pointer to parent, otherwise NULL
*/
union {
void *delta_priv; /* user delta private */
void *root_priv; /* user root private */
};