drbd_find_overlap(9)
π drbd_find_overlap(9) β the Kernel API Manual page, but make it make sense
okay so bestie, welcome to the Kernel API Manual entry for drbd_find_overlap β the little function that goes "hiii does anything in this tree overlap with the sector range I'm asking about?" and honestly? iconic behaviour honestly. π
β¨ NAME β¨
drbd_find_overlap β search for an interval overlapping with [sector, sector + size)
like yes that's literally the whole job and she does it slayfully π¦
πΈ SYNOPSIS πΈ
struct drbd_interval * drbd_find_overlap (struct rb_root *root ,
sector_t sector , unsigned int size );
that's the whole signature bestie, copy it exactly, do not freestyle it π
π«Ά ARGUMENTS π«Ά
rootβ red black tree root. yes the actual root of the tree, the main character of this whole situation πsectorβ start sector. where your search begins, the starting line, the origin story βsizeβ size, aligned to512bytes. keep that alignment in mind, it's not optional vibes, it's a real requirement π
π DESCRIPTION π
So here's the tea. drbd_find_overlap returns an interval overlapping with [sector, sector + size), or NULL if there is none. that's it, that's the vibe. no overlap, no interval, you get NULL, and you move on with your life π
lowkey important: when there is more than one overlapping interval in the tree, the interval with the lowest start sector is the one that gets returned. so she's not just returning any overlap β she's returning the earliest one, periodt.
and the rest of the overlapping intervals? bestie they don't get lost, okay? all other overlapping intervals will be on the right side of the tree, reachable with rb_next. so you can just keep walking with rb_next and collect every single one of them. no cap, they're all still there π
π SEE ALSO π
- Kernel file
./drivers/block/drbd/drbd_interval.cβ go read the source, it's giving "the receipts" π₯ drbd_contains_interval(9)β the sibling function, also worth your time, fr fr π
and that's the page!! π§ this little gem lives in ./drivers/block/drbd, dated October 2026 β mwah, go forth and find those overlaps bestie π
β¨π
π¦ 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