1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2018 Mellanox Technologies. All rights reserved */
9 bool (*delta_check
)(void *priv
, const void *parent_obj
,
11 void * (*delta_create
)(void *priv
, void *parent_obj
, void *obj
);
12 void (*delta_destroy
)(void *priv
, void *delta_priv
);
13 void * (*root_create
)(void *priv
, void *obj
, unsigned int root_id
);
14 #define OBJAGG_OBJ_ROOT_ID_INVALID UINT_MAX
15 void (*root_destroy
)(void *priv
, void *root_priv
);
22 const void *objagg_obj_root_priv(const struct objagg_obj
*objagg_obj
);
23 const void *objagg_obj_delta_priv(const struct objagg_obj
*objagg_obj
);
24 const void *objagg_obj_raw(const struct objagg_obj
*objagg_obj
);
26 struct objagg_obj
*objagg_obj_get(struct objagg
*objagg
, void *obj
);
27 void objagg_obj_put(struct objagg
*objagg
, struct objagg_obj
*objagg_obj
);
28 struct objagg
*objagg_create(const struct objagg_ops
*ops
,
29 struct objagg_hints
*hints
, void *priv
);
30 void objagg_destroy(struct objagg
*objagg
);
32 struct objagg_obj_stats
{
33 unsigned int user_count
;
34 unsigned int delta_user_count
; /* includes delta object users */
37 struct objagg_obj_stats_info
{
38 struct objagg_obj_stats stats
;
39 struct objagg_obj
*objagg_obj
; /* associated object */
44 unsigned int root_count
;
45 unsigned int stats_info_count
;
46 struct objagg_obj_stats_info stats_info
[];
49 const struct objagg_stats
*objagg_stats_get(struct objagg
*objagg
);
50 void objagg_stats_put(const struct objagg_stats
*objagg_stats
);
52 enum objagg_opt_algo_type
{
53 OBJAGG_OPT_ALGO_SIMPLE_GREEDY
,
56 struct objagg_hints
*objagg_hints_get(struct objagg
*objagg
,
57 enum objagg_opt_algo_type opt_algo_type
);
58 void objagg_hints_put(struct objagg_hints
*objagg_hints
);
59 const struct objagg_stats
*
60 objagg_hints_stats_get(struct objagg_hints
*objagg_hints
);