tools lib bpf: Rename set_private() to set_priv()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 3 Jun 2016 15:38:21 +0000 (12:38 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 6 Jun 2016 21:19:49 +0000 (18:19 -0300)
For consistency with class__priv() elsewhere, and with the callback
typedef for clearing those areas (e.g. bpf_map_clear_priv_t).

Acked-by: Wang Nan <wangnan0@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-rnbiyv27ohw8xppsgx0el3xb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/perf/util/bpf-loader.c

index 7eb7fb26e9996c2fb954a41219e5ed610e6c9f72..462e526a4465cbe66552b35de8a1ca1f9292be9c 100644 (file)
@@ -1218,9 +1218,8 @@ bpf_program__next(struct bpf_program *prev, struct bpf_object *obj)
        return &obj->programs[idx];
 }
 
-int bpf_program__set_private(struct bpf_program *prog,
-                            void *priv,
-                            bpf_program_clear_priv_t clear_priv)
+int bpf_program__set_priv(struct bpf_program *prog, void *priv,
+                         bpf_program_clear_priv_t clear_priv)
 {
        if (prog->priv && prog->clear_priv)
                prog->clear_priv(prog, prog->priv);
@@ -1319,8 +1318,8 @@ const char *bpf_map__name(struct bpf_map *map)
        return map ? map->name : NULL;
 }
 
-int bpf_map__set_private(struct bpf_map *map, void *priv,
-                        bpf_map_clear_priv_t clear_priv)
+int bpf_map__set_priv(struct bpf_map *map, void *priv,
+                    bpf_map_clear_priv_t clear_priv)
 {
        if (!map)
                return -EINVAL;
index 372cecbde20718d04d1cde1ff7f949101f2e9b35..722f46b2d553fa13e10f22f116bf7016a3b61e51 100644 (file)
@@ -78,8 +78,8 @@ struct bpf_program *bpf_program__next(struct bpf_program *prog,
 typedef void (*bpf_program_clear_priv_t)(struct bpf_program *,
                                         void *);
 
-int bpf_program__set_private(struct bpf_program *prog, void *priv,
-                            bpf_program_clear_priv_t clear_priv);
+int bpf_program__set_priv(struct bpf_program *prog, void *priv,
+                         bpf_program_clear_priv_t clear_priv);
 
 void *bpf_program__priv(struct bpf_program *prog);
 
@@ -184,8 +184,8 @@ const struct bpf_map_def *bpf_map__def(struct bpf_map *map);
 const char *bpf_map__name(struct bpf_map *map);
 
 typedef void (*bpf_map_clear_priv_t)(struct bpf_map *, void *);
-int bpf_map__set_private(struct bpf_map *map, void *priv,
-                        bpf_map_clear_priv_t clear_priv);
+int bpf_map__set_priv(struct bpf_map *map, void *priv,
+                     bpf_map_clear_priv_t clear_priv);
 void *bpf_map__priv(struct bpf_map *map);
 
 #endif
index 1907d531396021df4bbb3668db6d074f5ded05c5..dcc8845881aec9bea6ca1220669d89ad83b4c02b 100644 (file)
@@ -339,7 +339,7 @@ config_bpf_program(struct bpf_program *prog)
        }
        pr_debug("bpf: config '%s' is ok\n", config_str);
 
-       err = bpf_program__set_private(prog, priv, clear_prog_priv);
+       err = bpf_program__set_priv(prog, priv, clear_prog_priv);
        if (err) {
                pr_debug("Failed to set priv for program '%s'\n", config_str);
                goto errout;
@@ -910,7 +910,7 @@ bpf_map__add_op(struct bpf_map *map, struct bpf_map_op *op)
                }
                INIT_LIST_HEAD(&priv->ops_list);
 
-               if (bpf_map__set_private(map, priv, bpf_map_priv__clear)) {
+               if (bpf_map__set_priv(map, priv, bpf_map_priv__clear)) {
                        free(priv);
                        return -BPF_LOADER_ERRNO__INTERNAL;
                }
@@ -1515,7 +1515,7 @@ int bpf__setup_stdout(struct perf_evlist *evlist __maybe_unused)
                        if (!priv)
                                return -ENOMEM;
 
-                       err = bpf_map__set_private(map, priv, bpf_map_priv__clear);
+                       err = bpf_map__set_priv(map, priv, bpf_map_priv__clear);
                        if (err) {
                                bpf_map_priv__clear(map, priv);
                                return err;