ldm_relative(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ldm_relative πŸ’…

okay bestie, so this is a page from the Kernel API Manual β€” yes, ldm_relative(9), she's a kernel function and she's iconic. sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

ldm_relative β€” calculate the next relative offset πŸŽ€


🌸 SYNOPSIS 🌸

int ldm_relative (const u8 *buffer , int buflen , int base , int offset
);

like, that's the whole signature, no cap. five seconds to read, forever to love πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • buffer β€” the block of data you're working on rn. your main character data blob πŸ‘‘
  • buflen β€” the size of that block of data. yes, we need to know how big she is πŸ’…
  • base β€” the size of the previous fixed width fields. those are the predictable ones, love them for that 🌈
  • offset β€” the cumulative size of the previous variable-width fields. the chaotic ones. we love her anyway πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: a lot of the VBLK fields are variable-width, right? which means you literally cannot just skip ahead a fixed number of bytes like some kind of clown 🀑 β€” you have to calculate each offset based on the previous one and the length of the field it pointed to. that's the whole vibe. that's the gig. one step at a time, bestie ✨


πŸ”₯ RETURN πŸ”₯

  • -1 β€” error, babe 😭. the calculated offset exceeded the size of the buffer. she went too far. out of bounds. we don't stan.
  • n β€” OK βœ…, a range-checked offset into buffer. safe, valid, hydrated, moisturized, in her lane 🧚

⭐ SEE ALSO ⭐

okay this is the part where the group chat gets long. kernel file ./block/partitions/ldm.c, and the whole friend group:

ldm_parse_privhead(9), ldm_parse_tocblock(9), ldm_parse_vmdb(9), ldm_compare_privheads(9), ldm_compare_tocblocks(9), ldm_validate_privheads(9), ldm_validate_tocblocks(9), ldm_validate_vmdb(9), ldm_validate_partition_table(9), ldm_get_disk_objid(9), ldm_create_data_partitions(9), ldm_get_vnum(9), ldm_get_vstr(9), ldm_parse_cmp3(9), ldm_parse_dgr3(9), ldm_parse_dgr4(9), ldm_parse_dsk3(9), ldm_parse_dsk4(9), ldm_parse_prt3(9), ldm_parse_vol5(9), ldm_parse_vblk(9), ldm_ldmdb_add(9), ldm_frag_add(9), ldm_frag_free(9), ldm_frag_commit(9), ldm_get_vblks(9), ldm_free_vblks(9), ldm_partition(9)

every single one of them. no skips. the whole squad showed up 🫢πŸ”₯


ngl, if you're reading this you're probably deep in ./block/partitions at some unhinged hour. hydrate. then go read the rest of them πŸ’€πŸ’–

mwah πŸ’‹ that's the page! big kiss from ./block/partitions, dated October 2026, and yeah β€” she's still ldm_relative(9), always and forever πŸ‘‘βœ¨

πŸ“¦ where this page comes from