(1) Hash table supporting different key types (using a union type)
(2) "Subclassing" a struct by declaring a struct with the same fields and additional data at the end:
- parent struct hlist_node - https://github.com/torvalds/linux/blob/95381debd9ee8787256c3cdb92d2b167efa4b863/include/linux/types.h#L189
- child struct - https://github.com/torvalds/linux/blob/c6dd78fcb8eefa15dd861889e0f59d301cb5230c/fs/mount.h#L27
- the hlist_node data is embedded inline at the start of struct mountpoint
- docs - https://static.lwn.net/kerneldoc/core-api/kernel-api.html
In memory:
struct hlist_node |#####|
struct mountpoint |#####|############|
A function that works on hlist_nodes can then also be called on a list of mountpoint.
e.g. hlist_for_each_entry() used on mountpoint: https://github.com/torvalds/linux/blob/cbafe18c71028d5e0ee1626b4776fea5d5824a78/fs/namespace.c#L686