ceph_start_io_read(9)
π 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 π
- Kernel file
./fs/ceph/io.c ceph_end_io_read(9)ceph_start_io_write(9)ceph_end_io_write(9)ceph_start_io_direct(9)ceph_end_io_direct(9)
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
- 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