NVME_MI_ADMIN_GET_ANA_LOG_ATOMIC(2)
β¨ nvme_mi_admin_get_ana_log_atomic β¨
okay bestie, buckle up, because this is a little function from the libnvme API manual (that's section 2, the syscalls-and-library-calls girlies) and it's literally the way to yoink the Asymmetric Namespace Access log page β atomically, no cap. π¦
πΈ NAME πΈ
nvme_mi_admin_get_ana_log_atomic β Retrieve Asymmetric Namespace Access log page atomically π
π SYNOPSIS π
int nvme_mi_admin_get_ana_log_atomic (nvme_mi_ctrl_t ctrl , bool rgo ,
bool rae , unsigned int retries , struct nvme_ana_log *log , __u32 *len
);
π ARGUMENTS π
ctrlβ the Controller you wanna query, periodt. that's your main character.rgoβ whether to retrieve ANA groups only, like, no NSIDs invited to the party. πraeβ whether to retain asynchronous events. yes queen, hold onto those events.retriesβ the maximum number of times to retry when the log page keeps changing on you. it's giving "try again bestie" energy. π₯logβ pointer to a buffer that's gonna receive the ANA log page. this is where the tea gets poured. πlenβ okay so this one is doing double duty: on input it's the length of the log page buffer, and on output it's the actual length of the ANA log page. she contains multitudes. β¨
π DESCRIPTION π
See struct nvme_ana_log for the definition of the returned structure. that's the blueprint for what you're getting back, iykyk. π«Ά
β RETURN β
- If everything slays: returns
0and sets*lento the actual log page length. π - If it does NOT slay: returns the nvme command status if a response was received (see
enum nvme_status_field), or-1witherrnoset otherwise.
and now the errno drama, because there is so much:
- Sets
errno=EINVALifretries == 0. like, you asked for zero retries, girl, be so fr. π - Sets
errno=EAGAINif it was unable to read the log page atomically becausechgcntchanged during each of the retries attempts. the page kept moving. not me getting ghosted by a log page. π - Sets
errno=ENOSPCif the full log page does not fit in the provided buffer. your buffer is too small and the log page is too iconic for it. π
heads up bestie: if the atomic read just cannot happen becausechgcntflips on every single retry, you're gettingEAGAIN, and there is no magic fix, you just gotta go again. π
July 2026 energy, libnvme API manual source, and that's the whole vibe check β go read that ANA log page atomically, you absolute legend. ππ§
π¦ where this page comes from
- ubuntu stonking: libnvme-dev 1.16.2-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms