ldm_get_disk_objid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ldm_get_disk_objid β€” the ldm_get_disk_objid(9) glow-up

okay so real talk, this one lives in the Kernel API Manual, and it's a little function with a big job: it goes digging through a linked list of vblk's to find a given Disk Id. bestie, it's giving "detective with a flashlight in a server room" energy and honestly? iconic. πŸ”¦βœ¨


🌸 NAME 🌸

ldm_get_disk_objid β€” Search a linked list of vblk's for a given Disk Id

like, that's literally the whole assignment. find the disk id. slay. πŸ’…


✨ SYNOPSIS ✨

struct vblk * ldm_get_disk_objid (const struct ldmdb *ldb );

one function, one pointer in, one pointer out. no drama, no cap. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • ldb β€” Cache of the database structures ✨ this is the stash, the little wardrobe of db structs you're gonna rummage through, iykyk.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: the LDM Database contains a list of all partitions on all dynamic disks. like, all of them. every single one. 😭

The primary PRIVHEAD, sitting right at the beginning of the physical disk, tells us the GUID of this disk. that's the little name tag the disk wears at the party. πŸŽ€

So this function? it searches for the GUID in a linked list of vblk's. that's it. that's the vibe check. it walks the list, looking for the one that matches. main character energy, one job, does it well. πŸ‘‘


⭐ RETURN ⭐

  • Pointer β€” A matching vblk was found πŸŽ‰ periodt, we found it
  • NULL β€” No match, or an error πŸ’€ so either it's not there, or something went sideways
ngl, NULL is doing double duty here β€” no match and error both land on NULL, so don't go assuming it's always "just not found," bestie. πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./block/partitions/ldm.c β€” and the whole friend group, fr fr:

like, that's the entire group chat and every single one of them ate. πŸ”₯πŸ‘‘


anyway that's the whole page, bestie 🧚 β€” this little icon came from the source tree at ./block/partitions and it's stamped October 2026, so go forth and find those disk ids. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from