aya-ebpf: Remove `AyaBtfMapMarker`

It was never necessary in the first place. There is no place in the
kernel that enforces BTF map structs themselves to be anonymous. Only
pointer types (that are members of BTF maps) have to be anonymous, but
that's currently handled by LLVM[0].

BTF maps work just fine without it.

[0] https://github.com/llvm/llvm-project/pull/163174
reviewable/pr1382/r3
Michal R 3 days ago
parent 17573e0e47
commit 70919e3597

@ -1,22 +1,9 @@
use core::marker::PhantomData;
pub mod array;
pub mod sk_storage;
pub use array::Array;
pub use sk_storage::SkStorage;
/// A marker used to remove names of annotated types in LLVM debug info and
/// therefore also in BTF.
#[repr(transparent)]
pub(crate) struct AyaBtfMapMarker(PhantomData<()>);
impl AyaBtfMapMarker {
pub(crate) const fn new() -> Self {
Self(PhantomData)
}
}
#[macro_export]
macro_rules! btf_map_def {
($name:ident, $t:ident) => {
@ -30,9 +17,6 @@ macro_rules! btf_map_def {
value: *const V,
max_entries: *const [i32; M],
map_flags: *const [i32; F],
// Anonymize the struct.
_anon: $crate::btf_maps::AyaBtfMapMarker,
}
#[expect(
@ -47,7 +31,6 @@ macro_rules! btf_map_def {
value: ::core::ptr::null(),
max_entries: ::core::ptr::null(),
map_flags: ::core::ptr::null(),
_anon: $crate::btf_maps::AyaBtfMapMarker::new(),
}
}
}

Loading…
Cancel
Save