libnvme_tra...decide_retry(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvme_tra...decide_retry(9)

okay bestie, pull up a chair πŸ’– this one lives in the libnvme API manual, section 9, and it's the little function that lets you be the boss of retries. no cap.


✨ NAME ✨

libnvme_transport_handle_set_decide_retry β€” install a retry-decision callback πŸŽ€

like, you're handing the transport a little note that says "hey, if a command fails, ask me before you try again."


πŸ¦‹ SYNOPSIS πŸ¦‹

void libnvme_transport_handle_set_decide_retry (struct
libnvme_transport_handle *hdl , bool (*decide_retry)(struct
libnvme_transport_handle *hdl, struct libnvme_passthru_cmd *cmd, int
err) );

it returns void, it takes a handle, it takes a function pointer. that's the whole vibe. 🫢


🌸 ARGUMENTS 🌸

  • hdl β€” the transport handle you're configuring. your main character struct, basically. πŸ‘‘
  • decide_retry β€” the callback that decides whether a passthrough command should get retried after an error. the way it works: it gets called with the command that failed and the error code that came back from the kernel or the device. then it should return true if the submission path should retry the command, or false if the error is final β€” like, no takebacks, we're done here. πŸ’€

πŸ”₯ DESCRIPTION πŸ”₯

So what this does: it installs a user-provided callback that controls retry behavior for passthrough commands issued through hdl. literally that's it, that's the function.

The whole point is giving transports β€” or higher-level logic β€” room to implement their own custom retry policies. like retrying on transient conditions such as -EAGAIN, or on device-specific status codes. iykyk. ✨

🚨 important one, bestie: passing NULL clears any previously installed callback and reverts to the default behavior β€” which is no retries. so if you nuke it, nothing gets retried. periodt.

⭐ RETURN ⭐

None. β€” yeah, nothing comes back. it just sets the thing. πŸ’œ


and that's the page!! 🧚 this gorgeousness comes from the libnvme API manual, dated October 2026 β€” go off, October 2026, you ate. πŸ“πŸ’…

πŸ“¦ where this page comes from