STRUCT FUSE_FILE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct fuse_file(9) πŸ’–

okay bestie, so we're deep in the Kernel API Manual today β€” like, kernel-internals deep β€” and this one is all about struct fuse_file, which is literally just the FUSE-specific file data. that's it, that's the vibe. it's the little bundle of bookkeeping that hangs off a file in FUSE-land. πŸ¦‹


✨ SYNOPSIS ✨

like, here's the whole shape of it, no notes:

struct fuse_file {
    struct fuse_mount *fm;
    union fuse_file_args *args;
    u64 kh;
    u64 fh;
    u64 nodeid;
    refcount_t count;
    u32 open_flags;
    struct list_head write_entry;
    struct {
      loff_t pos;
      loff_t cache_off;
      u64 version;
    } readdir;
    struct rb_node polled_node;
    wait_queue_head_t poll_wait;
    enum {
      IOM_NONE,
      IOM_CACHED,
    IOM_UNCACHED } iomode;
  #ifdef CONFIG_FUSE_PASSTHROUGH;
    struct file *passthrough;
    const struct cred *cred;
  #endif;
    bool flock:1;
 };

she's giving "small struct, big responsibilities" honestly πŸŽ€


🌸 Members 🌸

so here's the rundown on every single field, because we do NOT skip fields in this house:

  • fm β€” the fuse connection that this file belongs to. like, who's your mount, bestie?
  • args β€” argument space that's reserved for open/release. reserved! as in, don't touch, it's saved for later πŸ’…
  • kh β€” the kernel file handle, and ngl it's guaranteed to be unique. iconic behavior.
  • fh β€” the file handle that userspace actually uses. different from kh, don't mix them up πŸ™ˆ
  • nodeid β€” the node id of this file. it's literally its little name tag.
  • count β€” the refcount. the way that refcount goes up and down... main character energy fr fr
  • open_flags β€” the FOPEN_* flags that came back from open.
  • write_entry β€” entry sitting on the inode's write_files list. that's the whole description, no cap.
  • readdir β€” everything readdir-related. she's a little struct of her own with pos, cache_off, and version inside.
  • polled_node β€” an RB node that gets linked onto fuse_conn->polled_files.
  • poll_wait β€” the wait queue head for poll. yes, poll. we love a wait queue πŸ’œ
  • iomode β€” does this file hold a fi->iocachectr refcount? that's the question, and IOM_NONE, IOM_CACHED, IOM_UNCACHED are the answers 🫢
  • passthrough β€” a reference to the backing file when you're in passthrough mode. (only a thing under CONFIG_FUSE_PASSTHROUGH, iykyk)
  • cred β€” the passthrough file credentials. also a CONFIG_FUSE_PASSTHROUGH girlie.
  • flock β€” has flock even been performed on this file? bool bitfield, one bit, huge consequences ✨

πŸ”₯ SEE ALSO πŸ”₯

okay so if you're going down the rabbit hole (and you will), the kernel file to go look at is ./fs/fuse/fuse_i.h, and the friends you'll bump into are:


okay that's genuinely all of it β€” every field, every flag, nothing skipped, periodt. πŸ’…

and for the cute little sign-off: this page lives over at ./fs/fuse and it's dated October 2026, so like... future vibes only, bestie. go read the source, ily, bye! πŸŽ€πŸ’–πŸŒΈ

πŸ“¦ where this page comes from