libbpf: Factor out common operations in BTF writing APIs
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 5 Nov 2020 04:33:51 +0000 (20:33 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 6 Nov 2020 02:37:30 +0000 (18:37 -0800)
commitc81ed6d81e0560713ceb94917ff1981848d0614e
treeefee2fdb07ac80e8b2019def78b2cd0ebf2f12b0
parentd0b3d2d7e50de5ce121f77a16df4c17e91b09421
libbpf: Factor out common operations in BTF writing APIs

Factor out commiting of appended type data. Also extract fetching the very
last type in the BTF (to append members to). These two operations are common
across many APIs and will be easier to refactor with split BTF, if they are
extracted into a single place.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20201105043402.2530976-2-andrii@kernel.org
tools/lib/bpf/btf.c