STRUCT P9_RDIR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct p9_rdir β€” readdir accounting ✨

okay so this is a page from the Kernel API Manual, bestie, and it's about struct p9_rdir, which is lowkey the little bookkeeping goblin that keeps track of readdir. cute, right? let's get into it πŸŽ€


✨ NAME ✨

struct p9_rdir β€” readdir accounting. that's it. that's the whole vibe. it counts and tracks things for readdir and it does it slayfully πŸ’–


🌸 SYNOPSIS 🌸

struct p9_rdir {
    int head;
    int tail;
    loff_t offset;
    uint8_t buf[];
};

look at her. four little members. main character energy fr fr πŸ‘‘


πŸ¦‹ Members πŸ¦‹

  • head β€” the start offset of the current dirread buffer. like where the good stuff begins 🌈
  • tail β€” the end offset of the current dirread buffer. where it stops. the other end. iconic behavior πŸ’…
  • offset β€” the file position that the data at head corresponds to. yes, specifically the data at head, not tail, don't get it twisted bestie πŸ™ˆ
  • buf β€” the dirread buffer itself. the actual buffer. the moment 🫢

πŸ’œ Description πŸ’œ

so what is this thing?? it's a private structure for keeping track of readdir, and it gets allocated on demand β€” not up front, not always hanging around, only when it's needed. very "i'll be there when you need me" of her tbh ✨

that's literally the whole description and honestly? she ate. no cap πŸ’€


⭐ SEE ALSO ⭐

go check out the Kernel file ./fs/9p/vfs_dir.c and these besties too:


🫢 also quick heads up: this lives in ./fs/9p and the page is dated October 2026 β€” so like, future vibes only. write it down, iykyk πŸ’–βœ¨πŸŽ€

that's the whole page bestie, go forth and readdir responsibly πŸŒΈπŸ¦‹πŸ’…

πŸ“¦ where this page comes from