VFS_FHTOVP(9)

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

🌸 NAME 🌸

okay so bestie, VFS_FHTOVP is a thing from the Kernel Developer's Manual β€” yes, VFS_FHTOVP(9), iykyk β€” and it does exactly one iconic job: turn an NFS filehandle into a vnode. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

the include vibe check comes first, then the signature, exactly like this:

#include <sys/param.h>
#include <sys/mount.h>
#include <sys/vnode.h>

int
VFS_FHTOVP(struct mount *mp, struct fid *fhp, int flags,
    struct vnode **vpp);

πŸ¦‹ DESCRIPTION πŸ¦‹

the VFS_FHTOVP() macro is used by the NFS server to turn an NFS filehandle into a vnode. no cap, that's its main character moment. ✨

the arguments it expects are:

  • mp β€” the file system.
  • fhp β€” the filehandle to convert.
  • flags β€” additional locking flags to pass through to vget(9). File systems are allowed to ignore flags and use LK_EXCLUSIVE instead. so don't be shocked if they do, bestie. πŸ’…
  • vpp β€” return parameter for the new locked vnode.

the contents of the filehandle are defined by the file system and are not examined by any other part of the system. it should contain enough information to uniquely identify a file within the file system as well as noticing when a file has been removed and the file system resources have been reused for a new file. for instance, UFS file system stores the inode number and inode generation counter in its filehandle. πŸŽ€

a call to VFS_FHTOVP() should generally be preceded by a call to VFS_CHECKEXP(9) to check if the file is accessible to the client. like, do the check first, fr fr. 🫢


πŸ’– RETURN VALUES πŸ’–

the locked vnode for the file will be returned in *vpp. that's the return. slay. πŸ‘‘


🌈 SEE ALSO 🌈

go read these next, bestie:


πŸŽ€ AUTHORS πŸŽ€

this manual page was written by Doug Rabson. shoutout to Doug, the author of this manual page. πŸ’œ


mwah πŸ’‹ this whole page is brought to you by Debian, dated May 19, 2019, and it's VFS_FHTOVP(9) β€” periodt. 🫢

πŸ“¦ where this page comes from