STRUCT FUSE_CONN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct fuse_conn(9) β€” A Fuse connection

okay bestie, so this is a page from the Kernel API Manual, and it's literally all about struct fuse_conn β€” the little (huge) struct that is a FUSE connection. no cap, this thing is the main character of the whole FUSE mount situation, so let's get into it πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole vibe, every single field, verbatim, don't touch anything:

struct fuse_conn {
    spinlock_t lock;
    refcount_t count;
    atomic_t epoch;
    struct work_struct epoch_work;
    struct rcu_head rcu;
    kuid_t user_id;
    kgid_t group_id;
    struct pid_namespace *pid_ns;
    struct user_namespace *user_ns;
    unsigned max_read;
    unsigned max_write;
    unsigned int max_pages;
    unsigned int max_pages_limit;
    struct fuse_chan *chan;
    atomic64_t khctr;
    struct rb_root polled_files;
    unsigned congestion_threshold;
    unsigned conn_error:1;
    unsigned conn_init:1;
    unsigned async_read:1;
    unsigned abort_err:1;
    unsigned atomic_o_trunc:1;
    unsigned export_support:1;
    unsigned writeback_cache:1;
    unsigned parallel_dirops:1;
    unsigned handle_killpriv:1;
    unsigned cache_symlinks:1;
    unsigned int legacy_opts_show:1;
    unsigned handle_killpriv_v2:1;
    unsigned no_open:1;
    unsigned no_opendir:1;
    unsigned no_fsync:1;
    unsigned no_fsyncdir:1;
    unsigned no_flush:1;
    unsigned no_setxattr:1;
    unsigned setxattr_ext:1;
    unsigned no_getxattr:1;
    unsigned no_listxattr:1;
    unsigned no_removexattr:1;
    unsigned no_lock:1;
    unsigned no_access:1;
    unsigned no_create:1;
    unsigned no_bmap:1;
    unsigned no_poll:1;
    unsigned big_writes:1;
    unsigned dont_mask:1;
    unsigned no_flock:1;
    unsigned no_fallocate:1;
    unsigned no_rename2:1;
    unsigned auto_inval_data:1;
    unsigned explicit_inval_data:1;
    unsigned do_readdirplus:1;
    unsigned readdirplus_auto:1;
    unsigned async_dio:1;
    unsigned no_lseek:1;
    unsigned posix_acl:1;
    unsigned default_permissions:1;
    unsigned allow_other:1;
    unsigned no_copy_file_range:1;
    unsigned no_copy_file_range_64:1;
    unsigned int destroy:1;
    unsigned int delete_stale:1;
    unsigned int no_control:1;
    unsigned int no_force_umount:1;
    unsigned int auto_submounts:1;
    unsigned int sync_fs:1;
    unsigned int init_security:1;
    unsigned int create_supp_group:1;
    unsigned int inode_dax:1;
    unsigned int no_tmpfile:1;
    unsigned int direct_io_allow_mmap:1;
    unsigned int no_statx:1;
    unsigned int passthrough:1;
    unsigned int use_pages_for_kvec_io:1;
    unsigned int no_link:1;
    unsigned int sync_init:1;
    int max_stack_depth;
    unsigned minor;
    struct list_head entry;
    dev_t dev;
    u32 scramble_key[4];
    atomic64_t attr_version;
    atomic64_t evict_ctr;
    u32 name_max;
    void (*release)(struct fuse_conn *);
    struct rw_semaphore killsb;
  #ifdef CONFIG_FUSE_DAX;
    enum fuse_dax_mode dax_mode;
    struct fuse_conn_dax *dax;
  #endif;
    struct list_head mounts;
    struct fuse_sync_bucket *curr_bucket;
  #ifdef CONFIG_FUSE_PASSTHROUGH;
    struct idr backing_files_map;
  #endif;
 };

πŸ¦‹ Members

πŸ”’ the locking & lifetime girlies

  • lock β€” the lock that protects: polled_files, backing_files_map, curr_bucket. she's guarding three things at once, multitasking icon πŸ’…
  • count β€” the refcount, bestie
  • epoch β€” the current epoch, for up-to-date dentries
  • epoch_work β€” used to invalidate dentries from old epochs
  • rcu β€” used to delay freeing fuse_conn, making it safe

🫢 the "who even are you" identity block

  • user_id β€” the user id for this mount
  • group_id β€” the group id for this mount
  • pid_ns β€” the pid namespace for this mount
  • user_ns β€” the user namespace for this mount

πŸ“ sizes & limits

  • max_read β€” maximum read size
  • max_write β€” maximum write size
  • max_pages β€” maximum number of pages that can be used in a single request
  • max_pages_limit β€” constrain ->max_pages to this value during feature negotiation

🚚 transport & handles

  • chan β€” transport layer object
  • khctr β€” the next unique kernel file handle
  • polled_files β€” rbtree of fuse_files waiting for poll events indexed by ph
  • congestion_threshold β€” number of background requests at which congestion starts

🩹 connection-status bits

  • conn_error β€” connection failed (version mismatch). Cannot race with setting other bitfields since it is only set once in INIT reply, before any other request, and never cleared
  • conn_init β€” connection successful. Only set in INIT
  • async_read β€” do readahead asynchronously? Only set in INIT
  • abort_err β€” return an unique read error after abort. Only set in INIT

πŸŽ€ the behaviour flags, in original order (yes, all of them)

  • atomic_o_trunc β€” do not send separate SETATTR request before open(O_TRUNC)
  • export_support β€” filesystem supports NFS exporting. Only set in INIT
  • writeback_cache β€” write-back cache policy (default is write-through)
  • parallel_dirops β€” allow parallel lookups and readdir (default is serialized)
  • handle_killpriv β€” handle fs handles killing suid/sgid/cap on write/chown/trunc
  • cache_symlinks β€” cache READLINK responses in page cache
  • legacy_opts_show β€” show legacy mount options
  • handle_killpriv_v2 β€” fs kills suid/sgid/cap on write/chown/trunc. suid is killed on write/trunc only if caller did not have CAP_FSETID. sgid is killed on write/truncate only if caller did not have CAP_FSETID as well as file has group execute permission.
  • no_open β€” is open/release not implemented by fs?
  • no_opendir β€” is opendir/releasedir not implemented by fs?
  • no_fsync β€” is fsync not implemented by fs?
  • no_fsyncdir β€” is fsyncdir not implemented by fs?
  • no_flush β€” is flush not implemented by fs?
  • no_setxattr β€” is setxattr not implemented by fs?
  • setxattr_ext β€” does file server support extended setxattr
  • no_getxattr β€” is getxattr not implemented by fs?
  • no_listxattr β€” is listxattr not implemented by fs?
  • no_removexattr β€” is removexattr not implemented by fs?
  • no_lock β€” are posix file locking primitives not implemented by fs?
  • no_access β€” is access not implemented by fs?
  • no_create β€” is create not implemented by fs?
  • no_bmap β€” is bmap not implemented by fs?
  • no_poll β€” is poll not implemented by fs?
  • big_writes β€” do multi-page cached writes
  • dont_mask β€” don't apply umask to creation modes
  • no_flock β€” are BSD file locking primitives not implemented by fs?
  • no_fallocate β€” is fallocate not implemented by fs?
  • no_rename2 β€” is rename with flags implemented by fs?
  • auto_inval_data β€” use enhanced/automatic page cache invalidation.
  • explicit_inval_data β€” filesystem is fully responsible for page cache invalidation.
  • do_readdirplus β€” does the filesystem support readdirplus?
  • readdirplus_auto β€” does the filesystem want adaptive readdirplus?
  • async_dio β€” does the filesystem support asynchronous direct-IO submission?
  • no_lseek β€” is lseek not implemented by fs?
  • posix_acl β€” does the filesystem support posix acls?
  • default_permissions β€” check permissions based on the file mode or not?
  • allow_other β€” allow other than the mounter user to access the filesystem ?
  • no_copy_file_range β€” does the filesystem support copy_file_range?
  • no_copy_file_range_64 β€” does the filesystem support copy_file_range_64?
  • destroy β€” send DESTROY request
  • delete_stale β€” delete dentries that have gone stale
  • no_control β€” do not create entry in fusectl fs
  • no_force_umount β€” do not allow MNT_FORCE umount
  • auto_submounts β€” auto-mount submounts announced by the server
  • sync_fs β€” propagate syncfs to server
  • init_security β€” initialize security xattrs when creating a new inode
  • create_supp_group β€” add supplementary group info when creating a new inode
  • inode_dax β€” does the filesystem support per inode DAX?
  • no_tmpfile β€” is tmpfile not implemented by fs?
  • direct_io_allow_mmap β€” relax restrictions to allow shared mmap in FOPEN_DIRECT_IO mode
  • no_statx β€” is statx not implemented by fs?
  • passthrough β€” passthrough support for read/write IO
  • use_pages_for_kvec_io β€” use pages instead of pointer for kernel I/O
  • no_link β€” is link not implemented by fs?
  • sync_init β€” is synchronous FUSE_INIT allowed?

🌸 more numbers & bookkeeping

  • max_stack_depth β€” maximum stack depth for passthrough backing files
  • minor β€” negotiated minor version
  • entry β€” entry on the fuse_conn_list
  • dev β€” device ID from the root super block
  • scramble_key β€” key for lock owner ID scrambling
  • attr_version β€” version counter for attribute changes
  • evict_ctr β€” version counter for evict inode
  • name_max β€” maximum file name length
  • release β€” called on final put
  • killsb β€” read/write semaphore to hold when accessing the sb of any fuse_mount belonging to this connection

🧚 the CONFIG-gated ones

  • dax_mode β€” Dax mode
  • dax β€” Dax specific conn data, non-NULL if DAX is enabled
  • mounts β€” list of filesystems using this connection
  • curr_bucket β€” new writepages go into this bucket
  • backing_files_map β€” IDR for backing files ids

πŸ‘‘ Description

so this structure is created when the root filesystem is mounted, and it's destroyed when the client device is closed and the last fuse_mount is destroyed. literally birth and death of a connection, it's giving full life cycle πŸ¦‹βœ¨


🌈 SEE ALSO

kernel file ./fs/fuse/fuse_i.h β€” plus these besties: struct fuse_submount_lookup(9), struct fuse_inode(9), struct fuse_file(9), fuse_fill_super_common(9), fuse_mount_remove(9), fuse_ctl_add_conn(9), fuse_ctl_remove_conn(9)


πŸ’€ real talk though: those #ifdef CONFIG_FUSE_DAX and #ifdef CONFIG_FUSE_PASSTHROUGH blocks mean some of these fields only exist in certain kernel configs. not every build gets the whole squad, iykyk πŸ™ˆ

okay that's the whole page, go off bestie πŸ’– this one came straight out of ./fs/fuse and it's dated October 2026 β€” save the date, screenshot it, put it on the fridge πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from