STRUCT MTD_WRITE_REQ(9)
π struct mtd_write_req(9) π
okay bestie, welcome to the Kernel API Manual β¨ β this is the whole entire page about struct mtd_write_req, which is literally the data structure you use when you wanna request a write operation. it's giving "small struct, big responsibilities" fr fr π
πΈ NAME πΈ
struct mtd_write_req β the data structure for requesting a write operation π«Ά (yes that's it, that's the whole vibe)
β¨ SYNOPSIS β¨
here's the literal shape of it, copy it exactly, no improvising:
struct mtd_write_req {
__u64 start;
__u64 len;
__u64 ooblen;
__u64 usr_data;
__u64 usr_oob;
__u8 mode;
__u8 padding[7];
};
π Members π
each field, one by one, no skipping π€
startβ the start address. that's where the whole thing begins πlenβ length of the data buffer. careful tho: only the lower 32 bits are used β the rest is just vibes πooblenβ length of the OOB buffer. same story: only the lower 32 bits are used πusr_dataβ the user-provided data buffer, aka where your actual bytes live πusr_oobβ the user-provided OOB buffer π¦modeβ the MTD mode (peep "MTD operation modes" for the tea) πpaddingβ reserved!! must be set to 0 β do not touch, do not decorate, just zero it and move on π
π Description π
so this structure is the main character for ioctl(MEMWRITE) operations π₯ it lets you do data writes and/or OOB writes in various modes, which is honestly so versatile of it.
here's the little cheat sheet:
- wanna write OOB-only? set
usr_data == NULL⨠- wanna write data-only? set
usr_oob == NULLβ¨
bestie pls π setting bothusr_dataandusr_oobtoNULLis NOT allowed. like, at all. don't do it. i'm begging.
π¦ SEE ALSO π¦
go read these next, iykwim π
- Kernel file
./include/uapi/mtd/mtd-abi.hstruct mtd_read_req_ecc_stats(9)struct mtd_read_req(9)struct mtd_ecc_stats(9)
and that's the whole page!! π mwah π«Ά this little cutie lives over in ./include/uapi/mtd, dated October 2026, and it's filed under struct mtd_write_req(9) in the Kernel API Manual β periodt π
β¨πΈ
π¦ 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