nvme_submit_admin_passthru(2)
β¨ nvme_submit_admin_passthru(2) β the libnvme API manual, bestie edition β¨
okay so picture this: you're deep in the kernel-adjacent trenches, you've got a file descriptor to an nvme device, and you need to yeet an admin command straight at it. that's this function. this is the girl. π
It lives in the libnvme API manual β section 2, nvme_submit_admin_passthru(2), no cap.
πΈ NAME πΈ
nvme_submit_admin_passthru β Submit an nvme passthrough admin command π
π¦ SYNOPSIS π¦
int nvme_submit_admin_passthru (int fd , struct nvme_passthru_cmd *cmd ,
__u32 *result );
π ARGUMENTS π
fdβ File descriptor of nvme device. yes bestie, the actual handle to the thing you're talking to. you gotta have it, it's giving "entry pass to the club". πͺͺcmdβ The nvme admin command to send. this is the whole entire mission, the command struct carrying your admin op. she's the main character. πresultβ Optional field to return the result from the CQE DW0. optional! so you can pass it, but you don't have to. if you do, she hands back the result from the CQE DW0. iykyk. β¨
π DESCRIPTION π
Uses NVME_IOCTL_ADMIN_CMD for the ioctl request. that's it, that's the whole vibe β that's the ioctl doing the heavy lifting underneath. lowkey iconic. π₯
β RETURN β
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.
so: got a response? you get the nvme command status back (peep enum nvme_status_field for what those numbers mean π«Ά). no response? it's a -1 and errno is set, and you go read errno like the detective you are. π
real talk: don't just assume success from a non--1, bestie. the return is the command status β check it properly. π
and that's the whole page, periodt. π§ this was the libnvme API manual, dated July 2026 β go forth and submit those admin passthroughs responsibly. mwah. ππΈπ
π¦ 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