ubi_leb_read_sg(9)
π ubi_leb_read_sg β Kernel API Manual, but make it bestie-friendly π
okay so this is page ubi_leb_read_sg(9) from the Kernel API Manual, and honestly? she's a little niche but she ATE. let's get into it π
β¨ NAME β¨
ubi_leb_read_sg β read data into a scatter gather list. that's the whole vibe. she reads, she gathers, she scatters. iconic behavior fr π
π¦ SYNOPSIS π¦
int ubi_leb_read_sg (struct ubi_volume_desc *desc , int lnum , struct ubi_sgl *sgl , int offset , int len , int check );
that's six arguments bestie, count 'em. she's a committed function π₯
πΈ ARGUMENTS πΈ
descβ the volume descriptor. it's giving "your hall pass for this volume" energy π«lnumβ the logical eraseblock number you're reading from. which block? this block. be specific π―sglβ the UBI scatter gather list where the read data gets stored. this is the destination, the main character of the operation πoffsetβ offset within the logical eraseblock to read from. not from the start of everything, from the start of this block. important distinction, iykyk πlenβ how many bytes to read. how many?len. slay πcheckβ whether UBI has to check the read data's CRC or not. your call, bestie, but choose wisely π«Ά
β DESCRIPTION β
so here's the tea: this function works exactly like ubi_leb_read_sg. (yes she said her own name. no i'm not fixing it, i'm just the messenger π«‘)
BUT β and this is the plot twist β instead of storing the read data into a buffer, she writes to an UBI scatter gather list. same energy, different destination. buffer who? never heard of her π
π SEE ALSO π
the kernel file lives at ./drivers/mtd/ubi/kapi.c in case you need to go read the source like the little detective you are π
and here's the whole friend group, all invited to the party:
ubi_do_get_device_info(9)ubi_get_device_info(9)ubi_do_get_volume_info(9)ubi_get_volume_info(9)ubi_open_volume(9)ubi_open_volume_nm(9)ubi_get_num_by_path(9)ubi_open_volume_path(9)ubi_close_volume(9)leb_read_sanity_check(9)ubi_leb_read(9)ubi_leb_write(9)ubi_leb_erase(9)ubi_leb_unmap(9)ubi_leb_map(9)ubi_is_mapped(9)ubi_sync(9)ubi_register_volume_notifier(9)ubi_unregister_volume_notifier(9)
lowkey a whole squad. go read them, they're all lore-relevant π
and that's the page!! mwah π this one's signed off from ./drivers/mtd/ubi and dated October 2026 β so mark your calendars besties, the future is now βπ¦β¨
π¦ 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