bio_endio_bh(9)
π bio_endio_bh(9)
okay so bestie, we're in the Kernel API Manual today and this lil function is called bio_endio_bh β literally the cleanup crew for a bio you used to submit a buffer. she's giving "you started this, now finish it" energy β¨
πΈ SYNOPSIS πΈ
bool bio_endio_bh (struct bio *bio , struct buffer_head **bhp );
π ARGUMENTS π
bioβ the bio. that's her. that's the girl.bhpβ where to return thebuffer_head. like, the drop-off address for your buffer head π«Ά
π¦ DESCRIPTION π¦
so here's the vibe: you call this inside your bio_end_io handler to retrieve the buffer_head that got submitted in bh_submit. that's the whole point of her π
β οΈ ok but listen β if you did not call bh_submit, do not call this function. it will return garbage. like, actual literal garbage, not a cute vibe, not a metaphor, just garbage π
also important, ngl: this function consumes the bio refcount, which will probably free the bio. so yeah, she eats the refcount and the bio is likely gone after. main character behavior, honestly π
π₯ RETURN π₯
- True if the I/O succeeded. slay π
π SEE ALSO π
kernel file ./fs/buffer.c plus the whole friend group:
end_buffer_read_sync(9)bh_end_read(9)bh_end_write(9)bh_end_async_write(9)mmb_sync(9)block_dirty_folio(9)mark_buffer_dirty(9)__brelse(9)__bforget(9)bh_submit(9)bdev_getblk(9)__bread_gfp(9)block_invalidate_folio(9)clean_bdev_aliases(9)try_to_free_buffers(9)bh_uptodate_or_lock(9)__bh_read(9)__bh_read_batch(9)
okay that's the whole page bestie, ily, go free those bios responsibly π§ββοΈπ
signed off from the ./fs directory β October 2026 edition, bio_endio_bh(9), periodt. π
π¦ 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