devlink_regi...pshot_id_get(9)
π devlink_regi...pshot_id_get(9) β bestie edition π
okay so this is a page from the Kernel API Manual and honestly the function name is so long it needs its own zip code, but we're gonna get through it together, i promise π«Ά
β¨ NAME β¨
devlink_region_snapshot_id_get β literally just: get a snapshot ID. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
int devlink_region_snapshot_id_get (struct devlink *devlink , u32 *id );
like, that's it. that's the whole signature. slay. β¨
π ARGUMENTS π
devlinkβ adevlink. yeah bestie, the argument is literally just described as "devlink". iconic minimalism, no notes πidβ the storage where the id gets returned. it's au32 *, so hand her a pointer and she'll fill it in for you π
π DESCRIPTION π
so here's the tea: this callback should be called whenever you're adding a new snapshot. and the driver β yes, the driver, your main character β should use the same id for multiple snapshots taken on multiple regions at the same time / by the same trigger. no cap, that's the whole point of the id. one trigger, one id, many regions. periodt. π₯
now, important part, don't skip this: the caller of this function must use devlink_region_snapshot_id_put when they're finished creating regions using this id. it's giving "borrow my charger, but give it back". if you don't put it back... bestie. π
and the return? returns zero on success, or a negative error code on failure. that's it. zero = good vibes, negative = something went sideways π«Ά
π SEE ALSO π
okay this section is a whole friend group, get cozy:
- the Kernel file
./net/devlink/region.cβ where the magic lives, iykyk __devlink_snapshot_id_increment(9)β¨__devlink_snapshot_id_decrement(9)β¨__devlink_snapshot_id_insert(9)β¨__devlink_region_snapshot_id_get(9)β¨__devlink_region_snapshot_create(9)β¨devl_region_create(9)β¨devlink_region_create(9)β¨devlink_port_region_create(9)β¨devl_region_destroy(9)β¨devlink_region_destroy(9)β¨devlink_region_snapshot_id_put(9)β¨devlink_region_snapshot_create(9)β¨
π friendly reminder from your girl: every id you get needs a matching devlink_region_snapshot_id_put. this is not a drill, this is a lifestyle. π
and that's the whole page, bestie!! this gem dropped in October 2026 and lives under the source path ./net/devlink β go forth, get those ids, and remember: zero on success, negative on failure, and always put back what you got πππ
π¦ 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