brelse(9)
β¨ NAME β¨
Hey bestie, welcome to the brelse(9) page from the Kernel API Manual π«Ά β today's main character is brelse, and its whole job is releasing a buffer. Periodt.
π¦ SYNOPSIS π¦
void brelse (struct buffer_head *bh );
π ARGUMENTS π
bhβ the buffer you're releasing. That's the argument, bestie, no hidden lore.
π DESCRIPTION π
Okay so brelse decrements a buffer_head's reference count. If bh is NULL, this function is a no-op β literally nothing happens, no crash, no drama, we love a safe little guard moment π.
Now for the slightly more unhinged part: if all buffers on a folio have zero reference count, are clean and unlocked, and if the folio is unlocked and not under writeback, then try_to_free_buffers may strip the buffers from the folio in preparation for freeing it. Sometimes β rarely β buffers are removed from a folio but it ends up not being freed, and buffers may later be reattached. Not me explaining the rare plot twist π it's giving "almost freed but make it comeback" and honestly? Iconic.
π CONTEXT π
Any context. Like, genuinely any β no special mood required, go off π .
π₯ SEE ALSO π₯
- Kernel file
./include/linux/buffer_head.h bforget(9)__bread(9)get_nth_bh(9)
Mwah π this little page was brought to you by ./include/linux, dated October 2026, and yes β the manual page is brelse(9), no cap β¨
π¦ 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