ata_phys_link_offline(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, so this is one of those tiny little libata helpers from the Kernel API Manual series, and honestly? She's short but she's got lore. Let's get into it 🫢


🌸 NAME 🌸

ata_phys_link_offline β€” the vibe check that tells you whether a given link is offline πŸ’€

✨ SYNOPSIS ✨

bool ata_phys_link_offline (struct ata_link *link );

πŸŽ€ ARGUMENTS πŸŽ€

  • link β€” the ATA link you wanna test, bestie. That's it. That's the whole argument πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

So the whole point: you're testing whether link is offline. Simple, right?

But here's the plot twist 😭 β€” this function returns 0 if the offline status of link can't be obtained at all. Like, no answer, no data, nada. Which means you cannot be out here assuming:

ata_link_online(link) != !ata_link_offline(link)

Nope. Not valid. Those two are not each other's opposites in this house πŸš«πŸ’… It's giving "not all zeros are equal."

LOCKING: None. Zero. Zilch. No locks, go off queen πŸ‘‘

⭐ RETURN ⭐

True if the port offline status is available and offline. If it's unavailable, you get 0 β€” remember the DESCRIPTION, don't come for me 😀

πŸ¦‹ SEE ALSO πŸ¦‹

And now, the group chat roll call πŸ“ž β€” from the kernel file ./drivers/ata/libata-core.c:


lowkey the most important takeaway: 0 means "couldn't even tell you," not "online." Don't let the bool fool you, bestie πŸ’€πŸ’–

and that's the whole page!! source dir is ./drivers/ata, version date October 2026 β€” mwah, go read some ata lore, ily πŸŽ€βœ¨πŸ‘‘

πŸ“¦ where this page comes from