devlink_shd_get(9)
π devlink_shd_get(9) π
okay bestie, straight from the Kernel API Manual: this one is about getting or creating a shared devlink instance. It's giving βyou already know them? then you already know themβ energy. π«Ά
β¨ NAME β¨
devlink_shd_get β Get or create a shared devlink instance. lowkey iconic. π
πΈ SYNOPSIS πΈ
struct devlink * devlink_shd_get (const char *id , const struct
devlink_ops *ops , size_t priv_size , const struct device_driver *driver
);
No cap, that's the whole signature. β¨
π ARGUMENTS π
idβ Identifier string (e.g., serial number) for the shared instance. It's the group-chat name, basically.opsβ Devlink operations structure. The whole ops vibe.priv_sizeβ Size of private data structure.driverβ Driver associated with the shared devlink instance.
π¦ DESCRIPTION π¦
Get an existing shared devlink instance identified by id, or create a new one if it doesn't exist. Return the devlink instance with a reference held. The caller must call devlink_shd_put when done. π«Ά
All callers sharing the same id must pass identical ops, priv_size and driver. A mismatch triggers a warning and returns NULL.
β οΈ bestie, do not play with this: a mismatch triggers a warning and returns NULL. periodt.
π RETURN π
Pointer to the shared devlink instance on success, NULL on failure. That's the whole vibe check. β
π SEE ALSO π
- Kernel file
./net/devlink/sh_dev.c devlink_shd_put(9)devlink_shd_get_priv(9)
xoxo, this page's source is ./net/devlink, dated October 2026. slay and read the source. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms