STRUCT NAND_IO_ITER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct nand_io_iter(9) β€” the NAND I/O iterator, bestie edition ✨

okay so this is a page from the Kernel API Manual, and it's about one little struct that does a lot of heavy lifting. stay with me πŸ’…


🌸 NAME 🌸

struct nand_io_iter β€” NAND I/O iterator. that's it, that's the vibe. it iterates. over NAND I/O. iconic behavior honestly πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

struct nand_io_iter {
    struct nand_page_io_req req;
    unsigned int oobbytes_per_page;
    unsigned int dataleft;
    unsigned int oobleft;
 };

four fields. no cap, that's the whole thing. she's small but she's doing the work 🫢


πŸ¦‹ Members πŸ¦‹

  • req β€” the current I/O request. like, the one we're on right now, main character energy ⭐
  • oobbytes_per_page β€” the maximum number of OOB bytes per page. that's the ceiling, bestie, don't go over it πŸ™ˆ
  • dataleft β€” how many data bytes are still left to read/write. the "are we there yet" counter πŸ’€
  • oobleft β€” same thing but for OOB bytes: the remaining number of OOB bytes to read/write πŸ“

πŸ’– Description πŸ’–

so here's the tea: specialized NAND layers can use this to iterate over all the pages covered by one MTD I/O request. literally all of them, one by one, no skipping ✨

and the way that it greatly simplifies the boiler-plate code you'd otherwise need to read/write data from/to a NAND device? that's the whole point. it's giving "let the iterator handle it, you go touch grass" 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./include/linux/mtd/nand.h β€” and now, the extended friend group πŸ’œ

that's a lot of cross-references and yes you should probably read the ones you need. iykyk πŸ”₯

k bye bestie, this page lives in ./include/linux/mtd, dated October 2026, and it's filed under struct nand_io_iter(9) β€” go read the rest of the kernel docs, slay πŸ’…πŸŽ€

πŸ“¦ where this page comes from