__bh_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ __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 β€” a struct buffer_head 🫢 that's it, that's the arg, it's your buffer head bestie
  • op_flags β€” appending REQ_OP_* flags besides REQ_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