summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/struct_ops.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-01-09 18:07:50 -0800
committerAndrii Nakryiko <andrii@kernel.org>2022-01-12 17:01:39 -0800
commit86c7ecad3bf83f6a03057b41b353a44b3a4c1f21 (patch)
tree7db88f835f95f7935c9a84558dc556a68312ca00 /tools/bpf/bpftool/struct_ops.c
parent0991f6a38f576aa9a5e34713e23c998a3310d4d0 (diff)
parent063fa26aab7d4b987b2c797d12dc457a475011e5 (diff)
Merge branch 'libbpf 1.0: deprecate bpf_map__def() API'
Christy Lee says: ==================== bpf_map__def() is rarely used and non-extensible. bpf_map_def fields can be accessed with appropriate map getters and setters instead. Deprecate bpf_map__def() API and replace use cases with getters and setters. Changelog: ---------- v1 -> v2: https://lore.kernel.org/all/20220105230057.853163-1-christylee@fb.com/ * Fixed commit messages to match commit titles * Fixed indentation * Removed bpf_map__def() usage that was missed in v1 ==================== Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/bpf/bpftool/struct_ops.c')
-rw-r--r--tools/bpf/bpftool/struct_ops.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/bpf/bpftool/struct_ops.c b/tools/bpf/bpftool/struct_ops.c
index 2f693b082bdb..e08a6ff2866c 100644
--- a/tools/bpf/bpftool/struct_ops.c
+++ b/tools/bpf/bpftool/struct_ops.c
@@ -480,7 +480,6 @@ static int do_unregister(int argc, char **argv)
static int do_register(int argc, char **argv)
{
LIBBPF_OPTS(bpf_object_open_opts, open_opts);
- const struct bpf_map_def *def;
struct bpf_map_info info = {};
__u32 info_len = sizeof(info);
int nr_errs = 0, nr_maps = 0;
@@ -510,8 +509,7 @@ static int do_register(int argc, char **argv)
}
bpf_object__for_each_map(map, obj) {
- def = bpf_map__def(map);
- if (def->type != BPF_MAP_TYPE_STRUCT_OPS)
+ if (bpf_map__type(map) != BPF_MAP_TYPE_STRUCT_OPS)
continue;
link = bpf_map__attach_struct_ops(map);