STRUCT NAND_IO_ITER(9)
β¨ 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 π
struct nand_memory_organization(9)struct nand_row_converter(9)struct nand_pos(9)enum nand_page_io_req_type(9)struct nand_page_io_req(9)enum nand_ecc_engine_type(9)enum nand_ecc_placement(9)enum nand_ecc_algo(9)struct nand_ecc_props(9)struct nand_bbt(9)struct nand_ops(9)struct nand_ecc_context(9)struct nand_ecc_engine_ops(9)enum nand_ecc_engine_integration(9)struct nand_ecc_engine(9)struct nand_ecc_req_tweak_ctx(9)struct nand_ecc(9)struct nand_device(9)mtd_to_nanddev(9)nanddev_to_mtd(9)nanddev_page_size(9)nanddev_per_page_oobsize(9)nanddev_pages_per_eraseblock(9)nanddev_pages_per_target(9)nanddev_eraseblocks_per_lun(9)nanddev_eraseblocks_per_target(9)nanddev_target_size(9)nanddev_neraseblocks(9)nanddev_size(9)nanddev_get_memorg(9)nanddev_get_ecc_conf(9)nanddev_get_ecc_nsteps(9)nanddev_get_ecc_bytes_per_step(9)nanddev_get_ecc_requirements(9)nanddev_set_ecc_requirements(9)nanddev_register(9)nanddev_unregister(9)nanddev_set_of_node(9)nanddev_get_of_node(9)nanddev_offs_to_pos(9)nanddev_pos_cmp(9)nanddev_pos_to_offs(9)nanddev_pos_to_row(9)nanddev_pos_next_target(9)nanddev_pos_next_lun(9)nanddev_pos_next_eraseblock(9)nanddev_pos_next_page(9)nanddev_bbt_pos_to_entry(9)nanddev_bbt_is_initialized(9)
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
- 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