tools lib bpf: Remove _get_ from non-refcount method names

The use of this term is not warranted here, we use it in the kernel
sources and in tools/ for refcounting, so, for consistency, rename them.

Acked-bu: Wang Nan <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Milian Wolff <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
Arnaldo Carvalho de Melo 2016-06-03 12:22:51 -03:00
commit a7fe0450b0
3 changed files with 10 additions and 16 deletions

View file

@ -1186,20 +1186,14 @@ bpf_object__next(struct bpf_object *prev)
return next;
}
const char *
bpf_object__get_name(struct bpf_object *obj)
const char *bpf_object__name(struct bpf_object *obj)
{
if (!obj)
return ERR_PTR(-EINVAL);
return obj->path;
return obj ? obj->path : ERR_PTR(-EINVAL);
}
unsigned int
bpf_object__get_kversion(struct bpf_object *obj)
unsigned int bpf_object__kversion(struct bpf_object *obj)
{
if (!obj)
return 0;
return obj->kern_version;
return obj ? obj->kern_version : 0;
}
struct bpf_program *
@ -1375,7 +1369,7 @@ bpf_map__next(struct bpf_map *prev, struct bpf_object *obj)
}
struct bpf_map *
bpf_object__get_map_by_name(struct bpf_object *obj, const char *name)
bpf_object__find_map_by_name(struct bpf_object *obj, const char *name)
{
struct bpf_map *pos;

View file

@ -55,8 +55,8 @@ void bpf_object__close(struct bpf_object *object);
/* Load/unload object into/from kernel */
int bpf_object__load(struct bpf_object *obj);
int bpf_object__unload(struct bpf_object *obj);
const char *bpf_object__get_name(struct bpf_object *obj);
unsigned int bpf_object__get_kversion(struct bpf_object *obj);
const char *bpf_object__name(struct bpf_object *obj);
unsigned int bpf_object__kversion(struct bpf_object *obj);
struct bpf_object *bpf_object__next(struct bpf_object *prev);
#define bpf_object__for_each_safe(pos, tmp) \
@ -171,7 +171,7 @@ struct bpf_map_def {
*/
struct bpf_map;
struct bpf_map *
bpf_object__get_map_by_name(struct bpf_object *obj, const char *name);
bpf_object__find_map_by_name(struct bpf_object *obj, const char *name);
struct bpf_map *
bpf_map__next(struct bpf_map *map, struct bpf_object *obj);