__devlink_s...id_increment(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the Kernel API Manual ✨ this one's from the ./net/devlink corner of the kernel and she's a lil helper function with main character energy πŸ‘‘


✨ NAME ✨

__devlink_snapshot_id_increment β€” increments the number of snapshots that are using a given id πŸŽ€

yes literally that's it, that's the whole job, and she does it flawlessly πŸ’…

🌸 SYNOPSIS 🌸

int __devlink_snapshot_id_increment (struct devlink *devlink , u32 id );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • devlink β€” the devlink instance 🫢 (you know, the one doing the snapshotting)
  • id β€” the snapshot id πŸ’–

🌈 DESCRIPTION 🌈

okay so here's the tea β˜• β€” this function keeps track of when a new snapshot starts using an id. The way it works is honestly iconic: it loads the count for the given id out of the snapshot xarray, increments it, and stores it right back. Load β†’ bump β†’ store. periodt πŸ’€βœ¨

It gets called when a new snapshot is created with the given id. So every time somebody rolls up with that id, the count goes up by one πŸ”₯

⚠️ bestie listen to me β€” the id must have been previously allocated by devlink_region_snapshot_id_get. No cap. Don't be out here passing random ids, that's not the vibe πŸ™ˆ

It returns 0 on success, or an error on failure. Simple as that, slay πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./net/devlink/region.c β€” go read the source, it's giving transparency ✨


and that's the page, bestie 🫢 straight from ./net/devlink, dated October 2026, living in the Kernel API Manual β€” go forth and increment responsibly πŸ§šπŸ’œ πŸŽ€

πŸ“¦ where this page comes from