mtd_ooblayout_free(9)
mtd_ooblayout_free(9) β Kernel API Manual π
π NAME π
mtd_ooblayout_free β get the OOB region definition of a specific free section. Slay, that's the assignment, bestie. π
π SYNOPSIS π
int mtd_ooblayout_free (struct mtd_info *mtd , int section , struct
mtd_oob_region *oobfree );
π«Ά ARGUMENTS π«Ά
mtdβ the MTD device structure. Like, the device we're working with. β¨sectionβ the free section you're interested in. Depending on the layout, you may have all the free bytes stored in a single contiguous section, or one section per ECC chunk plus an extra section for the remaining bytes (or other funky layout). πoobfreeβ the OOB region struct filled with the appropriate free position information. It's giving "here's where the free stuff is." π
πΈ DESCRIPTION πΈ
Okay so mtd_ooblayout_free returns the free bytes position in the OOB area. The way that's its whole job? Obsessed. π If you want to get all the free bytes information, then you should call mtd_ooblayout_free(mtd, section++, oobfree) until it returns -ERANGE. That's the loop, lowkey iconic, iykyk. π
It returns zero on success, a negative error code otherwise. No cap. π―
π₯ SEE ALSO π₯
Kernel file ./drivers/mtd/mtdcore.c, plus the whole squad:
mtd_wunit_to_pairing_info(9)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_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)
That's the whole page, bestie π brought to you by source/version ./drivers/mtd, dated October 2026. Mwah πβ¨ 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