VFS_SET(9)
β¨ VFS_SET(9) β¨
okay bestie, welcome to the Kernel Developer's Manual, page VFS_SET(9) π this is the one that sets up your loadable file system's vfsconf and honestly? she's giving backstage-pass energy. let's get into it π
πΈ NAME πΈ
VFS_SET β set up loadable file system vfsconf π
π¦ SYNOPSIS π¦
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/mount.h>
void
VFS_SET(struct vfsops *vfsops, fsname, int flags);
like, yes, those includes are non-negotiable, do not skip them, they are the fit check before the function call π
π DESCRIPTION π
so VFS_SET() does two things and it does them flawlessly. first, it creates a vfsconf structure for the loadable module using the vfsops you hand it, plus fsname, plus flags. then it declares that whole thing by calling DECLARE_MODULE(9), with vfs_modevent() as the event handler. that's it. that's the whole slay. β¨
now, the flags argument β she has OPTIONS, and here's every single one, no skips, no crumbs left behind:
VFCF_STATICβ the file system should be statically available in the kernel.VFCF_NETWORKβ network exportable file system.VFCF_READONLYβ does not support write operations.VFCF_SYNTHETICβ pseudo file system, data does not represent on-disk files.VFCF_LOOPBACKβ loopback file system layer.VFCF_UNICODEβ file names are stored as Unicode.VFCF_JAILβ can be mounted from within a jail ifallow.mountandallow.mount.<fsname>jail parameters are set.VFCF_DELEGADMINβ supports delegated administration ifvfs.usermountsysctl is set to1.VFCF_SBDRYβ when in VFS method, the thread suspension is deferred to the user boundary upon arrival of stop action.
bestie note:VFCF_JAILandVFCF_DELEGADMINare conditional girlies β they only do their thing when those jail parameters / thatvfs.usermountsysctl are set. don't come for me, that's literally what the page says π
π§ PSEUDOCODE π§
here's the vibe, copy the shape, not the letters:
/*
* Fill in the fields for which we have special methods.
* The others are initially null. This tells vfs to change them to
* pointers to vfs_std* functions during file system registration.
*/
static struct vfsops myfs_vfsops = {
.vfs_mount = myfs_mount,
.vfs_root = myfs_root,
.vfs_statfs = myfs_statfs,
.vfs_unmount = myfs_unmount,
};
VFS_SET(myfs_vfsops, myfs, 0);
see how she only fills in the fields with special methods? the rest stay null on purpose, and that's intentional β it tells vfs to swap them for pointers to vfs_std* functions during file system registration. main character behavior fr fr π
π₯ SEE ALSO π₯
jail(2), jail(8), DECLARE_MODULE(9), vfs_modevent(9), vfsconf(9) β go read them, iykyk π«Ά
π AUTHORS π
this manual page was written by Chad David <davidc@acns.ab.ca>. thank you chad, king behavior, we appreciate you π
and that's the whole page bestie, no notes, ate and left no crumbs π
β¨ this cutie came to you from Debian, dated August 16, 2018, filed under VFS_SET(9) β mwah, go write a file system ππ
π¦ 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