do_filldir_main(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 fr
  • darr β€” an array of struct gfs2_dirent pointers to read, the whole lineup πŸ’…
  • entries β€” the number of entries in darr, count 'em
  • sort_start β€” index of the directory array to start our sort, like where the sorting era begins ⭐
  • copied β€” pointer to int that'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:


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