nvdimm_write_bytes(9)
πΎ nvdimm_write_bytes(9) β the Kernel API Manual page, bestie edition πΎ
okay so you opened nvdimm_write_bytes(9) from the Kernel API Manual and you're like "what is this function even doing" β don't worry, I got you, we're gonna read it together like it's a group chat π«Ά
β¨ NAME β¨
nvdimm_write_bytes β synchronously write bytes to an nvdimm namespace. that's it, that's the whole vibe. synchronous, no cap. π
πΈ SYNOPSIS πΈ
int nvdimm_write_bytes (struct nd_namespace_common *ndns ,
resource_size_t offset , void *buf , size_t size , unsigned long flags
);
literally just copy that exactly, bestie, don't retype it from memory π
π¦ ARGUMENTS π¦
ndnsβ the device you're writing to. the main character of this whole operation πoffsetβ the starting offset, and it's namespace-relative, meaning it's counted from the start of the namespace, not from anywhere else. important detail, iykyk.bufβ the buffer to drain. yes, drain. that's the word the manual uses, we respect it. πsizeβ transfer length, aka how many bytes are getting sent. πflagsβ the context you're in:0for process context,1for atomic context. pick correctly, no pressure π
π DESCRIPTION π
okay so here's the tea β β NVDIMM Namespaces disks do not implement sectors internally. that's just not a thing they do.
so depending on the ndns, when this routine returns, the contents of buf may be sitting in cpu cache, in platform buffers, or actually on backing memory media. three possibilities, and it's giving "it depends" energy π
and the flushing-to-media part? that's handled internal to the ndns driver β if it's handled at all. so don't go assuming it happens, because "if at all" is doing a lot of work in that sentence. π
β RETURN β
0on success π- a negative error code on failure π
that's the whole return section, short and iconic.
π SEE ALSO π
- Kernel file
./include/linux/nd.h struct nvdimm_pmu(9)struct nd_namespace_common(9)struct nd_namespace_io(9)struct nd_namespace_pmem(9)nvdimm_read_bytes(9)β the read girlie, the sibling, the counterpart π
and that's the page!! ngl this one was short but she ate. π
one last thing: this whole page lives in ./include/linux, and it's dated October 2026 β so go forth and write those bytes synchronously, bestie, and remember to check your context flag β¨π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms