VFSCONF(9)
β¨ VFSCONF(9) β¨
okay bestie, welcome to vfconf β aka vfs configuration information, from the Kernel Developer's Manual π
so like. this is the manual for vfsconf(9), which is the whole ~vibe infrastructure~ that lets the kernel know about file system types. it's giving very much "behind the scenes but make it essential" π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/mount.h>
int
vfs_register(struct vfsconf *vfc);
int
vfs_unregister(struct vfsconf *vfc);
int
vfs_modevent(module_t mod, int type, void *data);
like, that's the whole entrance exam right there π«Ά
π¦ DESCRIPTION π¦
Every single file system type the kernel knows about has a vfsconf structure. That structure holds literally all the info you need to create a new mount of that file system type. no cap, it's the blueprint π
struct vfsconf {
struct vfsops *vfc_vfsops; /* file system operations vector */
char vfc_name[MFSNAMELEN]; /* file system type name */
int vfc_typenum; /* historic file system type number */
int vfc_refcount; /* number mounted of this type */
int vfc_flags; /* permanent flags */
struct vfsconf *vfc_next; /* next in list */
};
so when a new file system gets mounted, mount(2) does a lookup of the vfsconf structure by its name. and if it's not already registered? it tries to load a kernel module for it. main character energy tbh.
The file system operations for the new mount point are taken from vfc_vfsops, and mnt_vfc in the mount structure is made to point directly at the vfsconf structure for the file system type. The file system type number comes from vfc_typenum, which was assigned back in vfs_register(), and the mount flags are taken from a mask of vfc_flags. Every single time a file system of a given type is mounted, vfc_refcount gets incremented. keeping count, periodt π
vfs_register() β takes a new vfsconf structure and adds it to the list of existing file systems. If the type hasn't already been registered, it gets initialized by calling the vfs_init() function in the file system operations vector. vfs_register() also updates the oid's of any sysctl nodes for this file system type so they match the newly assigned type number. slay π₯
vfs_unregister() β unlinks vfc from the list of registered file system types, but only if there are currently no mounted instances. If the vfs_uninit() function in the file systems initialization vector is defined, it gets called. bye bestie π
vfs_modevent() β this one is registered by VFS_SET() to handle the loading and unloading of file system kernel modules. In the case of MOD_LOAD, vfs_register() is called. In the case of MOD_UNLOAD, vfs_unregister() is called. iconic dispatcher behaviour ngl β¨
π RETURN VALUES π
vfs_register()β returns0if successful; otherwise,EEXISTis returned, indicating that the file system type has already been registered. (rude, but okay π)vfs_unregister()β returns0if successful.- If no
vfsconfentry can be found matching the name invfc,EINVALis returned. - If the reference count of mounted instances of the file system type is not zero,
EBUSYis returned. (can't unlink what's still in use, babe π) - If
vfs_uninit()is called, any errors it returns will be returned byvfs_unregister().
- If no
vfs_modevent()β returns the result of the call tovfs_register()orvfs_unregister(), whatever the case. it's just the messenger fr fr
π SEE ALSO π
go read those too, they're all part of the same lore iykyk π
π AUTHORS π
This manual page was written by Chad David <davidc@acns.ab.ca>. thank you chad, we love you for this π«ΆπΈ
and that's the tea, bestie β this was the VFSCONF(9) page from the Kernel Developer's Manual, Debian edition, dated June 16, 2013. go mount something responsibly πβ¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms