Re: [PATCH v3 02/30] tools lib bpf: Add private field for bpf_object
From: Alexei Starovoitov
Date: Sat Nov 26 2016 - 12:11:30 EST
On Sat, Nov 26, 2016 at 07:03:26AM +0000, Wang Nan wrote:
> Similar to other classes defined in libbpf.h (map and program), allow
> 'object' class has its own private data.
>
> Signed-off-by: Wang Nan <wangnan0@xxxxxxxxxx>
> Cc: Alexei Starovoitov <ast@xxxxxx>
> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> Cc: Li Zefan <lizefan@xxxxxxxxxx>
> ---
> tools/lib/bpf/libbpf.c | 23 +++++++++++++++++++++++
> tools/lib/bpf/libbpf.h | 5 +++++
> 2 files changed, 28 insertions(+)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 96a2b2f..866d5cd 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -229,6 +229,10 @@ struct bpf_object {
> * all objects.
> */
> struct list_head list;
> +
> + void *priv;
> + bpf_object_clear_priv_t clear_priv;
> +
> char path[];
> };
Acked-by: Alexei Starovoitov <ast@xxxxxxxxxx>