drbd_contains_interval(9)
π drbd_contains_interval(9) π
okay so bestie, welcome to the Kernel API Manual, section 9 β this is the page for drbd_contains_interval, and it's genuinely such a vibe. it's a little helper that just wants to know: is this interval in this tree or not? π let's get into it.
β¨ SYNOPSIS β¨
bool drbd_contains_interval (struct rb_root *root , sector_t sector ,
struct drbd_interval *interval );
like, that's the whole call. it hands you back a bool and you can go about your day. π¦
πΈ ARGUMENTS πΈ
rootβ the red black tree root π³ that's your starting point, the whole tree lives under heresectorβ the start sector of the interval π§ you're asking about,sector_tflavouredintervalβ and here's the spicy bit π₯: this one may be an invalid pointer. like, unhinged but true. it might not be a real thing at all, so don't go assuming
π DESCRIPTION π
so what does it actually do? it returns whether the tree contains the node interval with start sector sector. that's the whole question, that's the assignment. π
and the way it's careful with interval? iconic, honestly. it does not dereference interval until interval is known to be a valid object in the tree. so it's not gonna just yolo-read from a pointer that might be garbage β no cap, it checks first. π«Ά
one more little detail so you're not caught off guard: it returns false if interval is in the tree but with a different sector number. so like, present β matching, iykyk. π it's gotta be the right node and the right sector.
lowkey the moral of the story is: this function is safe to call with a sketchy interval pointer and it will not dereference it unless it's already confirmed valid in the tree. periodt. π
π SEE ALSO π
- the kernel file
./drivers/block/drbd/drbd_interval.cβ go read the source, it's right there π drbd_find_overlap(9)β the other interval bestie, go say hi β
and that's the page, diva π§π β this one came to you from ./drivers/block/drbd, dated October 2026, so go forth and check your intervals with confidence. slay. π
β¨π
π¦ 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