__bh_read(9)
π __bh_read(9) β the Kernel API Manual glow-up π
okay so bestie, we're in the Kernel API Manual today and the main character is __bh_read(9) β literally the function that submits a read for a locked buffer. yes queen, locked. don't come for me, that's what it says π
β¨ NAME β¨
__bh_read β Submit read for a locked buffer π¦
β¨ SYNOPSIS β¨
int __bh_read (struct buffer_head *bh , blk_opf_t op_flags , bool wait
);
like, that's the whole vibe. three args, one int coming back at you πΈ
β¨ ARGUMENTS β¨
bhβ astruct buffer_headπ«Ά that's it, that's the arg, it's your buffer head bestieop_flagsβ appendingREQ_OP_*flags besidesREQ_OP_READβ¨ (read is already the whole point, don't re-add it, iykyk)waitβbool, and it means wait until reading finish π yes. that's the description. we love a terse king π
β¨ DESCRIPTION β¨
so what does it return, you ask? π§ it returns zero on success or if you don't wait β and -EIO on error π literally the whole spec. no cap, that's it.
lowkey important: zero means "success or don't wait", so don't go reading tea leaves into that zero, bestie π
β¨ SEE ALSO β¨
Kernel file ./fs/buffer.c and its whole friend group β bio_endio_bh(9), 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_batch(9) β the whole squad, no one left behind ππ₯
and that's the page, bestie!! π sourced straight from ./fs, dated October 2026, and yeah we're citing __bh_read(9) one more time on the way out because the footer said so β 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