devlink_try_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, we're diving into the kernel API manual (devlink_try_get(9)) and honestly? this one is short but it's giving "small but mighty" energy. let's get into it πŸ’…


🌸 NAME 🌸

devlink_try_get β€” try to obtain a reference on a devlink instance

like, try. that word is doing a lot of work here, and we respect it 🫢


πŸŽ€ SYNOPSIS πŸŽ€

struct devlink * devlink_try_get (struct devlink *devlink );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • devlink β€” the instance you're trying to get a reference on. that's the one, bestie 🎯

πŸ’– DESCRIPTION πŸ’–

So here's the tea: devlink_try_get obtains a reference on a devlink instance. simple enough, right?

But wait β€” and this is the part you cannot skip, babes β€” a reference on a devlink instance only implies that it's safe to take the instance lock. that's it. that's the whole promise. βœ‹

It does not imply that the instance is registered. like, at all. so if you need to know whether it's actually registered, you gotta use devl_is_registered β€” and crucially, you call that after taking the instance lock to check the registration status. order matters, no cap. πŸ”₯

⚠️ do not assume a successful reference means "registered". it does not. take the lock, then check with devl_is_registered. periodt. πŸ’€

🌈 SEE ALSO 🌈


go read the source bestie, it's right there in ./net/devlink πŸ‘‘ iykyk

and that's a wrap on this one, my love πŸ’œ this page came from the ./net/devlink source, dated October 2026, in the devlink_try_get(9) era β€” iconic, honestly. mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from