ceph_start_io_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ceph_start_io_read β€” Kernel API Manual, bestie edition πŸ’–

okay so we're in the Kernel API Manual today and the star of the show is ceph_start_io_read(9). she's a little function with a big job, and honestly? she ate. let's get into it 🫢


✨ NAME ✨

ceph_start_io_read β€” bestie, this literally just declares that the file is being used for buffered reads. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

int ceph_start_io_read (struct inode *inode );

no cap, that's it. one argument, one int coming back at you. iconic ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • inode β€” the file inode. that's her. that's the girl. πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so here's the situation. when you call this, you're announcing "hey, a buffered read operation is about to start" β€” and you're also making sure we block all direct I/O. like, all of it. no direct I/O sneaking in during your read, not on her watch. 🚫

on exit, the function makes sure the CEPH_I_ODIRECT flag is unset, and it holds a shared lock on inode->i_rwsem so that the flag literally cannot be changed while you're holding it. locked down. immovable. periodt. πŸ”’

in practice, what does that mean? it means buffered read operations are allowed to execute in parallel, thanks to that shared lock β€” the girls are all reading together, no queue, no drama, we love a shared-lock moment 🌈. meanwhile direct I/O operations need to wait to grab an exclusive lock in order to set CEPH_I_ODIRECT. so they're lowkey stuck in line while the reads are out here living their best life πŸ˜­πŸ’€.

also pls note: buffered writes and truncates both take a write lock on inode->i_rwsem, which means those are serialised with respect to the reads. so it's not chaos in there β€” writes and truncates are politely waiting their turn while the reads do their parallel thing. main character energy is shared, we stan fair scheduling πŸ§šπŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

go read them all, they're the rest of the friend group and they're all slaying in their own way πŸ¦‹βœ¨


aaand that's the page!! πŸŽ€ this one's from ./fs/ceph, dated October 2026, and we're out here repping ceph_start_io_read(9) β€” stay buffered, stay shared-locked, and don't let direct I/O cut the line πŸ’œπŸ’…πŸ”₯

πŸ“¦ where this page comes from