STRUCT FUSE_FILE(9)
π 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 fromkh, 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 fropen_flagsβ theFOPEN_*flags that came back from open.write_entryβ entry sitting on the inode'swrite_fileslist. that's the whole description, no cap.readdirβ everything readdir-related. she's a little struct of her own withpos,cache_off, andversioninside.polled_nodeβ an RB node that gets linked ontofuse_conn->polled_files.poll_waitβ the wait queue head for poll. yes, poll. we love a wait queue πiomodeβ does this file hold afi->iocachectrrefcount? that's the question, andIOM_NONE,IOM_CACHED,IOM_UNCACHEDare the answers π«Άpassthroughβ a reference to the backing file when you're in passthrough mode. (only a thing underCONFIG_FUSE_PASSTHROUGH, iykyk)credβ the passthrough file credentials. also aCONFIG_FUSE_PASSTHROUGHgirlie.flockβ has flock even been performed on this file?boolbitfield, 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:
struct fuse_submount_lookup(9)struct fuse_inode(9)struct fuse_conn(9)fuse_fill_super_common(9)fuse_mount_remove(9)fuse_ctl_add_conn(9)fuse_ctl_remove_conn(9)
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
- 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