Commit 535ead44 authored by Andrii Nakryiko's avatar Andrii Nakryiko
Browse files

bpf: factor out fetching bpf_map from FD and adding it to used_maps list



Factor out the logic to extract bpf_map instances from FD embedded in
bpf_insns, adding it to the list of used_maps (unless it's already
there, in which case we just reuse map's index). This simplifies the
logic in resolve_pseudo_ldimm64(), especially around `struct fd`
handling, as all that is now neatly contained in the helper and doesn't
leak into a dozen error handling paths.

Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
parent 51a1ca93
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment