do_filldir_main(9)
π do_filldir_main(9) β a Kernel API Manual moment
okay so bestie, welcome to the Kernel API Manual entry for do_filldir_main(9), aka the little function that reads out directory entries β¨
πΈ NAME πΈ
do_filldir_main β read out directory entries π
β¨ SYNOPSIS β¨
int do_filldir_main (struct gfs2_inode *dip , struct dir_context *ctx ,
struct gfs2_dirent **darr , u32 entries , u32 sort_start , int *copied
);
π«Ά ARGUMENTS π«Ά
dipβ the GFS2 inode, the main character of this whole operation πctxβ what to feed the entries to, like, that's the destination fr frdarrβ an array ofstruct gfs2_direntpointers to read, the whole lineup πentriesβ the number of entries indarr, count 'emsort_startβ index of the directory array to start our sort, like where the sorting era begins βcopiedβ pointer tointthat's non-zero if a entry has been copied out π
π¦ DESCRIPTION π¦
so the vibe here is: we jump through some hoops π to make sure that if there are hash collisions, they are read out at the beginning of a buffer. no cap. the whole point is we want to minimize the possibility that they will fall into different readdir buffers, or that someone will want to seek to that location. like, we're being so considerate about it π
π₯ RETURN π₯
errno, and >0 if the actor tells you to stop π (yes, the actor is in charge here)
π 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)gfs2_dir_readahead(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)
and that's the whole page, bestie π§π this one's from ./fs/gfs2, dated October 2026 β mwah, go read your directory entries responsibly π
π¦ 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