gfs2_dir_readahead(9)
β¨ gfs2_dir_readahead β¨
Okay bestie, so this one's from the Kernel API Manual β it's gfs2_dir_readahead(9) and honestly it's giving "quiet little helper that does a lot of heavy lifting" energy π
Let's get into it.
πΈ NAME πΈ
gfs2_dir_readahead β issues read-ahead requests for leaf blocks. That's it, that's the whole vibe: it's the one out here pre-fetching leaf blocks so stuff feels fast later π¦
π SYNOPSIS π
void gfs2_dir_readahead (struct inode *inode , unsigned hsize , u32
index , struct file_ra_state *f_ra );
No return value, no drama β it's void, it just does the thing and dips β¨
π ARGUMENTS π
inodeβ the directory inode. The main character of this whole operation πhsizeβ hash table size. Big number energy πindexβ index into the hash table. Where we're peeking πf_raβ read-ahead parameters. The literal instructions for how much ahead to read π
π NOTE π
Okay so here's the lowkey sad part, and I need you to hear me out:
We can't calculate each index like dir_e_read can β because we don't have the leaf, and therefore we don't have the depth, and therefore we don't have the length π It's giving "three missing puzzle pieces in a row."
So instead we just have to read enough ahead to make up for the loss of information. Not ideal, not glamorous, but it works π«Ά
π SEE ALSO π
Kernel file ./fs/gfs2/dir.c plus the whole friend group:
gfs2_dir_write_data(9)gfs2_dir_read_data(9)gfs2_dir_get_hash_table(9)gfs2_dir_hash_inval(9)dirent_next(9)dirent_del(9)get_leaf_nr(9)dir_make_exhash(9)dir_split_leaf(9)dir_double_exhash(9)compare_dents(9)do_filldir_main(9)dir_e_read(9)gfs2_dir_search(9)dir_new_leaf(9)gfs2_dir_add(9)gfs2_dir_del(9)gfs2_dir_mvino(9)leaf_dealloc(9)gfs2_dir_exhash_dealloc(9)gfs2_diradd_alloc_required(9)
That's the whole page, bestie β sourced from ./fs/gfs2 and dated October 2026, so like, fresh out of the kernel kitchen π§ And that's a wrap, mwah π
π¦ 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