VFS_SET(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– VFS_SET(9) β€” from the Kernel Developer's Manual, but make it bestie-core ✨

okay so bestie, this is the VFS_SET(9) page from the Kernel Developer's Manual, and it's literally about setting up a loadable file system's vfsconf. no cap. πŸ«ΆπŸŽ€

🌸 NAME 🌸

VFS_SET β€” set up a loadable file system's vfsconf πŸ’…

✨ SYNOPSIS ✨

bring in these headers first, bestie:

#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/mount.h>

and the signature is exactly this, periodt:

void
VFS_SET(struct vfsops *vfsops, fsname, int flags);

πŸ¦‹ DESCRIPTION πŸ¦‹

VFS_SET() creates a vfsconf structure for the loadable module with the given vfsops, fsname and flags, then declares it by calling DECLARE_MODULE(9) using vfs_modevent() as the event handler. that's the whole plot. 😭

the possible values for the flags argument are:

  • VFCF_STATIC β€” the file system should be statically available in the kernel. periodt. 🌟
  • VFCF_NETWORK β€” network exportable file system. iconic. 🌈
  • VFCF_READONLY β€” does not support write operations. read-only icon behavior. πŸ’…
  • VFCF_SYNTHETIC β€” pseudo file system, data does not represent on-disk files. no on-disk files here, bestie. 🫧
  • VFCF_LOOPBACK β€” loopback file system layer. πŸŒ€
  • VFCF_UNICODE β€” file names are stored as Unicode. unicode girlies rise. 🌸
  • VFCF_JAIL β€” can be mounted from within a jail if allow.mount and allow.mount.<fsname> jail parameters are set. jail time, but only when the parameters say so. πŸ”
  • VFCF_DELEGADMIN β€” supports delegated administration if vfs.usermount sysctl is set to 1. delegated admin era. πŸ’–
  • VFCF_SBDRY β€” when in VFS method, the thread suspension is deferred to the user boundary upon arrival of stop action. stop action deferred, iykyk. πŸ›‘βœ¨

🧚 PSEUDOCODE 🧚

here's the pseudocode, literally:

/*
 * 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 ALSO πŸ”—

go give these a look too, bestie:

πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Chad David <davidc@acns.ab.ca>. ty Chad, you ate. πŸ’–

πŸ’– source/version: Debian Β· date: August 16, 2018 Β· page: VFS_SET(9) β€” bye bestie, go slay that loadable file system! ✨

πŸ“¦ where this page comes from