mtd_align_erase_req(9)
π mtd_align_erase_req β the Kernel API Manual, bestie edition π
okay so this is mtd_align_erase_req(9) from the kernel API manual and it is literally the glow-up artist for erase requests β¨ it takes your kinda-sloppy erase request and snaps it onto eraseblock boundaries. no cap, it's giving "personal stylist for structs."
β¨ NAME β¨
mtd_align_erase_req β Adjust an erase request to align things on eraseblock boundaries. π«Ά
πΈ SYNOPSIS πΈ
void mtd_align_erase_req (struct mtd_info *mtd , struct erase_info *req );
likeβ¦ that's it. one function, two pointers, zero drama. π
π¦ ARGUMENTS π¦
mtdβ the MTD device this erase request applies on. the main character device, iykyk πreqβ the erase request to adjust. this is the one getting the makeover π
β DESCRIPTION β
This function will adjust req->addr and req->len to align them on mtd->erasesize. π
so basically it grabs your request's address and length and lines them up all pretty on those eraseblock boundaries β the way that it just snaps everything into place? obsessed. π β¨
Of course we expectmtd->erasesizeto be!= 0. π fr fr, do not come in here with a zero erasesize, that's not the vibe, that's undefined-behavior-adjacent behavior and we don't stan π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/mtd/mtd.h struct mtd_oob_ops(9)struct mtd_oob_region(9)struct mtd_pairing_info(9)struct mtd_pairing_scheme(9)struct mtd_debug_info(9)struct mtd_part(9)struct mtd_master(9)
the whole struct squad, assembled π§π go read them, they're iconic.
and that's the page bestie π this one came out of ./include/linux/mtd, dated October 2026, and it's filed under mtd_align_erase_req(9) β slay, periodt, go align something. πΈπ¦π
π¦ 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