[$] Documenting counted-by relationships in kernel data structures

Post Syndicated from original https://lwn.net/Articles/936728/

The C language is expressive in many ways, but it still does not have ways
to express many of the relationships between fields in a data structure.
That gap can be at least partially filled, though, if one is willing to
create and use non-standard extensions. The adoption of of those
extensions, in the form of the __counted_by() macro, has been
merged for the 6.5 kernel release, even though the compiler feature it
depends on has not yet been finalized.