-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libbpf-cargo: Move generated struct_ops type out of types module
The struct_ops type is basically a libbpf-cargo construct -- there is no corresponding C type to be found in the BTF information (there is something similar in the C skeleton, but that is entirely orthogonal). However, because we generate this type inside the types module, which is the dumping ground for all Rust types with C equivalents, there is the potential for conflicts. For example, the kernel actually does have a type called struct_ops itself. That is not currently a problem, but it may become one once we generate Rust types for more of the C ones present in BTF. To fix this issue, move the generated struct_ops type out of the types module and into the "global" (from the skeleton's view) namespace. Also rename it to StructOps as an indication that this is a Rust construct without a C direct equivalent, similar to other generated types such as Open*Maps, Open*Progs, etc. Signed-off-by: Daniel Müller <[email protected]>
- Loading branch information
1 parent
0e65531
commit 95ad476
Showing
4 changed files
with
53 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters