bpf: Move BPF_MAP_TYPE for INODE_STORAGE and TASK_STORAGE outside of CONFIG_NET
authorTejun Heo <tj@kernel.org>
Thu, 21 Oct 2021 18:46:10 +0000 (08:46 -1000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 26 Oct 2021 19:35:16 +0000 (12:35 -0700)
commit99d0a3831e3500d945162cdb2310e3a5fce90b60
treeaa7c8bf91d82ffb445d20c9adf58cf11b5b2d9c3
parenta94b5aae2a40b164f1d67c37f466f06cb1398ef0
bpf: Move BPF_MAP_TYPE for INODE_STORAGE and TASK_STORAGE outside of CONFIG_NET

bpf_types.h has BPF_MAP_TYPE_INODE_STORAGE and BPF_MAP_TYPE_TASK_STORAGE
declared inside #ifdef CONFIG_NET although they are built regardless of
CONFIG_NET. So, when CONFIG_BPF_SYSCALL && !CONFIG_NET, they are built
without the declarations leading to spurious build failures and not
registered to bpf_map_types making them unavailable.

Fix it by moving the BPF_MAP_TYPE for the two map types outside of
CONFIG_NET.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: a10787e6d58c ("bpf: Enable task local storage for tracing programs")
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/YXG1cuuSJDqHQfRY@slm.duckdns.org
include/linux/bpf_types.h