STRUCT FILE_RA_STATE(9)
π struct file_ra_state(9) π
okay so bestie, welcome to the Kernel API Manual β yes, the actual kernel API manual, and yes we're reading it for fun. this page is all about struct file_ra_state, which is basically the little diary the kernel keeps about readahead. π
πΈ NAME πΈ
struct file_ra_state β track a file's readahead state, periodt. that's the whole vibe.
β¨ SYNOPSIS β¨
struct file_ra_state {
pgoff_t start;
unsigned int size;
unsigned int async_size;
unsigned int ra_pages;
unsigned short order;
unsigned short mmap_miss;
loff_t prev_pos;
};
look at her. seven fields. main character energy fr. π
π¦ Members π¦
okay literally let's go through every single one, no skipping, i promise:
startβ where the most recent readahead kicked off. the starting line, the origin story. π«sizeβ how many pages got read in the most recent readahead. the headcount, basically.async_sizeβ number of pages that were/are not needed immediately, and so were/are genuinely "ahead". when the first of these pages gets accessed, that's your cue to start the next readahead. she's the early-warning system, iykyk. π₯ra_pagesβ the maximum size of a readahead request, copied from the bdi. copied!! from the bdi!! respect her sources. β¨orderβ the preferred folio order used for the most recent readahead. fancy formatting choices, we love to see it.mmap_missβ how many mmap accesses missed in the page cache. a little counter of Ls tbh. πprev_posβ the last byte in the most recent read request. her most recent whereabouts. π
π Description π
so here's the tea π΅: when this structure gets passed to ->readahead, the "most recent" readahead means the current readahead. that's it, that's the note. context is everything, bestie.
π SEE ALSO π
Kernel file ./include/linux β and honestly the whole friend group came through:
enum positive_aop_returns(9), struct address_space(9), struct file(9), i_uid_into_vfsuid(9), i_uid_needs_update(9), i_uid_update(9), i_gid_into_vfsgid(9), i_gid_needs_update(9), i_gid_update(9), inode_fsuid_set(9), inode_fsgid_set(9), fsuidgid_has_mapping(9), inode_set_ctime(9), file_write_started(9), file_write_not_started(9), struct renamedata(9), is_mgtime(9), iput_if_not_last(9), is_idmapped_mnt(9), file_start_write(9), file_end_write(9), kiocb_start_write(9), kiocb_end_write(9), name_is_dot_dotdot(9), name_contains_dotdot(9), inode_dio_begin(9), inode_dio_end(9), generic_ci_validate_strict_name(9) π«Ά
like, the whole extended family. go say hi. they're all iconic.
ngl if you read all 30 of those you deserve a little treat π
and that's the page!! sign-off time: this one lives under ./include/linux, it's dated October 2026, and it's filed under struct file_ra_state(9) in the Kernel API Manual. slay, study hard, and drink some water. ππβ
π¦ 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