mtd_wunit_to_pairing_info(9)
π mtd_wunit_to_pairing_info(9) β like, the kernel API manual, bestie β¨
okay so real talk, this one lives in the Kernel API Manual and it's called mtd_wunit_to_pairing_info(9). It's giving "niche but iconic" π Let's go.
πΈ NAME πΈ
mtd_wunit_to_pairing_info β get the pairing info of a wunit. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
int mtd_wunit_to_pairing_info (struct mtd_info *mtd , int wunit , struct
mtd_pairing_info *info );
no cap, that's the exact signature, keep it exactly like that π
π¦ ARGUMENTS π¦
mtdβ pointer to the new MTD device info structure. it's the main character here, lowkey π«Άwunitβ the write unit we're interested in. yes, this specific one πinfoβ the returned pairing information. it gets filled in for you, slay π
π DESCRIPTION π
So you call this to retrieve the pairing information associated with the wunit. It's mainly useful when you're dealing with MLC/TLC NANDs, where pages can be paired together π and where programming a page may influence the page it's paired with. messy, I know.
The notion of page gets replaced by the term wunit (write-unit) so everything stays consistent with the ->writesize field. consistency is the blueprint, periodt β¨
The wunit argument can be extracted from an absolute offset using mtd_offset_to_wunit. And info gets filled with the pairing information attached to wunit. easy π
From that pairing info, the MTD user can find all the wunits paired with wunit using this loop:
for (i = 0; i < mtd_pairing_groups(mtd); i++) { info.pair = i;
mtd_pairing_info_to_wunit(mtd, info); ... }
literally copy that loop verbatim, it's not decorative, bestie π
π₯ SEE ALSO π₯
Kernel file ./drivers/mtd/mtdcore.c β plus the whole friend group, and honestly they all ate:
mtd_pairing_info_to_wunit(9), mtd_pairing_groups(9), add_mtd_device(9), del_mtd_device(9), mtd_device_parse_register(9), mtd_device_unregister(9), register_mtd_user(9), unregister_mtd_user(9), get_mtd_device(9), of_get_mtd_device_by_node(9), get_mtd_device_nm(9), mtd_ooblayout_ecc(9), mtd_ooblayout_free(9), mtd_ooblayout_find_region(9), mtd_ooblayout_find_eccregion(9), mtd_ooblayout_get_bytes(9), mtd_ooblayout_set_bytes(9), mtd_ooblayout_count_bytes(9), mtd_ooblayout_get_eccbytes(9), mtd_ooblayout_set_eccbytes(9), mtd_ooblayout_get_databytes(9), mtd_ooblayout_set_databytes(9), mtd_ooblayout_count_freebytes(9), mtd_ooblayout_count_eccbytes(9), mtd_kmalloc_up_to(9)
and that's the whole page, bestie π§ it comes from ./drivers/mtd, dated October 2026, and it's filed under mtd_wunit_to_pairing_info(9) β iykyk πππ¦
π¦ 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