VFS_CHECKEXP(9)

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

πŸ’– NAME πŸ’–

okay so welcome to the Kernel Developer's Manual page for VFS_CHECKEXP(9), bestie β€” this one is literally β€œcheck if a file system is exported to a client.” no cap, that’s the whole name. πŸŽ€

✨ SYNOPSIS ✨

the include vibes first, then the signature β€” copy these exactly, iykyk:

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

int
VFS_CHECKEXP(struct mount *mp, struct sockaddr *nam, uint64_t *exflagsp,
    struct ucred **credanonp, int *numsecflavor, int *secflavors);

🌸 DESCRIPTION 🌸

the VFS_CHECKEXP() macro is what the NFS server uses to check if a mount point is exported to a client. it’s giving β€œvibe check, but for export access” πŸ’…

the arguments it expects are:

  • mp β€” the mount point to be checked.
  • nam β€” an mbuf containing the network address of the client.
  • exflagsp β€” return parameter for the export flags for this client.
  • credanonp β€” return parameter for the anonymous credentials for this client.
  • numsecflavors β€” return value for the number of security flavors for this client.
  • secflavors β€” must be an array of size MAXSECFLAVORS, in which the security flavors for this client are returned.

so yeah: call VFS_CHECKEXP() on a file system's mount structure to determine if it is exported to a client whose address is contained in nam. that’s the mission. 🫢

it gets called in the NFS server once a vnode for a file handle has been acquired, so it can determine what access the client is allowed on the file system the vnode resides in. for NFSv4, it is also called whenever the lookup operation crosses a server file system mount point, to update the access information. iconic behavior, honestly. ⭐

the operation is file system specific, but is normally handled by the default vfs_stdcheckexp. lowkey the default does the heavy lifting.

πŸ¦‹ RETURN VALUES πŸ¦‹

the export flags, anonymous credentials and security flavors specific to the client will be returned in *exflagsp, *credanonp, *numsecflavors and *secflavors. periodt. πŸ’«

πŸ”₯ SEE ALSO πŸ”₯

πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Alfred Perlstein. shoutout, legend. πŸ’œ


mwah πŸ’‹ this one comes from Debian, dated June 17, 2020, and it’s page VFS_CHECKEXP(9) β€” bye bestie, go check those exports 🫢✨

πŸ“¦ where this page comes from