VFS_ROOT(9)
π VFS_ROOT π
okay so bestie, welcome to the VFS_ROOT page β it's from the Kernel Developer's Manual (section 9, the kernel-functions one, iykyk) and it's literally about getting your hands on the root vnode of a file system. slay. let's get into it π
β¨ NAME β¨
VFS_ROOT β return the root vnode of a file system πΈ
π¦ SYNOPSIS π¦
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/vnode.h>
int
VFS_ROOT(struct mount *mp, int flags, struct vnode **vpp);
π DESCRIPTION π
okay so the whole vibe here: this one returns a locked vnode for the root directory of the file system. locked, bestie β don't forget that part, it's the whole point π
Its arguments are, one by one:
mpβ the file system. like, the mount you're asking about.flagsβ the lock type. Could beLK_EXCLUSIVEorLK_SHARED. π and here's the tea: the file system is free to ignore the flags argument and instead acquire an exclusive lock. so don't come crying if you asked for shared and got exclusive, that's allowed, periodt.vppβ the return parameter for the root vnode. this is where you get your vnode back π«Ά
ngl the "free to ignore the flags argument" thing is highkey the most important sentence on this page. read it twice. π
π SEE ALSO π
π§ AUTHORS π§
This manual page was written by Doug Rabson. ty king πβ¨
and that's the whole page bestie, no cap, nothing skipped π β this was the Debian version, dated May 23, 2009, so like, vintage but iconic. go get that root vnode. mwah π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms