VFS_GETVFS(9)
π VFS_GETVFS π
ok so bestie, welcome to VFS_GETVFS, straight out of the Kernel Developer's Manual (section 9, we're in the deep end now and you're gonna slay). it's giving "find my mount point" energy and honestly? iconic.
β¨ NAME β¨
vfs_getvfs</purl> β returns a mount point given its file system identifier π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/mount.h>
struct mount *
vfs_getvfs(fsid_t *fsid);
π DESCRIPTION π
okay so here's the tea. the vfs_getvfs() function returns the mount point structure for a file system, given its file system identifier. literally just hand it an fsid and it hands you back the struct mount *. that's the whole vibe. π¦
β οΈ but bestie listen β that file system ID should have been allocated by calling vfs_getnewfsid(9). if it wasn't? it will not be found. no cap. not a single crumb. π
a major user of vfs_getvfs() is NFS β she's the main character here, fr fr. NFS uses the fsid as part of file handles, so it can figure out which file system a given RPC is for. and if vfs_getvfs() fails to find the mount point related to fsid, the file system is considered stale. it's giving ghosted. π»
π RETURN VALUES π
- if fsid is found β the mount point for the ID is returned β¨
- otherwise β
NULLis returned π
π§ PSEUDOCODE π§
here's the little snippet, copied exactly, no edits, we respect the source:
if ((mp = vfs_getvfs(&fhp->fh_fsid)) == NULL) {
error = ESTALE;
goto out;
}
see that ESTALE? yeah. stale. we hate to see it but we do see it. π
π SEE ALSO π
vfs_getnewfsid(9)β the girl who hands out the IDs in the first place π
π AUTHORS π
this manual page was written by Chad David <davidc@acns.ab.ca>. giving credit where credit is due, periodt. π«Ά
and that's a wrap, bestie!! this lil slice of kernel lore came to you via Debian, dated November 21, 2001 β yes it's been serving looks since 2001 and it still eats. go find those mount points, you've got this πβ¨π
π¦ 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