NVME_SET_FEATURES_WRITE_ATOMIC(2)
β¨ NAME β¨
nvme_set_features_write_atomic β the lil function that sets the write atomic feature on your NVMe device π it's giving "yes bestie, let's configure that atomicity"
Okay so real talk, this is from the libnvme API manual, section 2 of the manual pages, and it's lowkey one of those functions you call when you wanna tell your drive how to behave around write atomicity. Periodt.
πΈ SYNOPSIS πΈ
int nvme_set_features_write_atomic (int fd , bool dn , bool save , __u32 *result );
That's it, that's the whole vibe check. Four args, one int coming back at you π«Ά
π ARGUMENTS π
fdβ File descriptor of nvme device. Like, the handle to your drive. You gotta have one of these or we're not going anywhere, fr fr π¦dnβ Disable Normal. Yep, that's the flag name, it's literally "Disable Normal" and it's aboolso it's either on or off, no in-between πsaveβ Save value across power states. So if you want this setting to survive a reboot / power cycle situation, you set this. Main character energy: persistent. β¨resultβ The command completion result from CQE dword0. It's a__u32 *pointer, so the answer gets written back through here. The CQE is the completion queue entry, and dword0 is where the good stuff lives π
π RETURN π
So here's what you get back:
- The nvme command status if a response was received β and bestie, you check that status against
enum nvme_status_fieldto actually decode what happened π₯ - Or
-1witherrnoset otherwise π (that's the "something went sideways" path, anderrnowill tell you the tea)
ngl, if you're getting-1, go readerrnobefore you spiral. The info is right there. π
That's the whole page, no notes. π
Sign-off time: this iconic lil page came from the libnvme API manual, and its date stamp is July 2026 β so yeah, it's got that future-fresh energy βπΈ no cap, slay, bye bestie π«Άπ
π¦ 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