VFS_VGET(9)

πŸ’– VFS_VGET πŸ’–

okay bestie, welcome to the Kernel Developer's Manual, section 9 β€” this is where the kernel girlies live. today we're talking about VFS_VGET β€” the function that turns an inode number into a vnode. slay.


✨ NAME ✨

VFS_VGET β€” convert an inode number to a vnode πŸ¦‹


✨ SYNOPSIS ✨

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

int
VFS_VGET(struct mount *mp, ino_t ino, int flags, struct vnode **vpp);

✨ DESCRIPTION ✨

so. VFS_VGET() looks up or creates a vnode from a (mount, inode#) tuple. that's it, that's the whole vibe. it's giving "you gave me a number, i give you a vnode." iconic behavior fr fr πŸ’…

Its arguments are:

  • mp β€” the mount point. the location, the setting, the whole scene πŸŽ€
  • ino β€” the inode representing the file. this is a unique number assigned by the file system when vnodes are first created. no cap, it's literally one-of-a-kind per file.
  • flags β€” additional locking flags to pass through to vget(9). just handing them off, respectfully ✨
  • vpp β€” return parameter for the vnode. this is where the vnode comes back to you, bestie, like a little gift 🫢

This is an optional file system entry-point for file systems mainly intended for NFS server use, but many file systems use it internally in VOP_LOOKUP(9) and similar. so it's optional but also everyone's using it. the duality. the range. πŸ‘‘

If the file system does not support this call, then it should return EOPNOTSUPP. like, if you can't do it, just say you can't do it. honesty is the policy πŸ’€

Please see ffs_vget() in sys/ufs/ffs/ffs_vfsops.c for the canonical example. that's the reference implementation, the blueprint, the main character of examples 🌟


✨ SEE ALSO ✨


✨ AUTHORS ✨

This manual page was written by Doug Rabson. thank you king πŸ™‡β™€οΈ


okay that's the whole page bestie, go forth and convert those inode numbers πŸ¦‹βœ¨

Debian Β· January 7, 2005 Β· mwah πŸ’‹

πŸ“¦ where this page comes from