nanddev_offs_to_pos(9)
π nanddev_offs_to_pos(9) β like, the kernel API manual, but make it make sense
okay so bestie, this is a page from the Kernel API Manual, and today's main character is nanddev_offs_to_pos. no cap, it's a tiny little helper and it absolutely ate. let's get into it π«Ά
β¨ NAME β¨
nanddev_offs_to_pos β convert an absolute NAND offset into a NAND position πΈ
like, you hand it a number, it hands you a place. it's giving GPS for flash memory, literally.
π SYNOPSIS π
unsigned int nanddev_offs_to_pos (struct nand_device *nand , loff_t offs
, struct nand_pos *pos );
that's the whole vibe. three args, one return value, no drama π
π¦ ARGUMENTS π¦
nandβ the NAND device π like, the actual chip situation we're talking about hereoffsβ the absolute NAND offset, and ngl it's usually passed by the MTD layer (so you probably didn't even type it yourself)posβ a NAND position object that this function fills in β¨ you bring the empty container, it brings the contents
π DESCRIPTION π
so what it does is: it converts offs into a nand_pos representation. that's it. that's the whole thing. it takes your raw offset and turns it into the pretty structured position form π
lowkey iconic that something so simple gets its own manpage, but we respect it π
β RETURN β
it returns the offset within the NAND page pointed by pos π
so, like, not the same offset you gave it β a different offset, the one that lands inside that specific page. read the return value, bestie, don't just assume π
π§ SEE ALSO π§
okay this list is LONG, like genuinely a whole friend group, but they all matter so here we go π₯ first up, the Kernel file ./include/linux/mtd/nand.h, and then all of these cuties:
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)struct nand_io_iter(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_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)
fr fr that's the whole crew, go say hi π«Ά
ok that's the page!! no warnings, no bugs, no exit statuses β this one's a clean little angel ππ
and that's a wrap bestie π this cutie came from ./include/linux/mtd and is dated October 2026 β slay, see you in the next manpage π
β¨
π¦ 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