VFS_CHECKEXP(9)

πŸ’… VFS_CHECKEXP β€” the manual page, bestie edition (section 9, Kernel Developer's Manual, in case you were wondering)

okay so like. you're poking around the kernel dev docs and you found VFS_CHECKEXP(9). iconic of you honestly. let's get into it πŸŽ€


✨ NAME ✨

VFS_CHECKEXP β€” the little macro that checks if a file system is exported to a client 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

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

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

πŸ’– DESCRIPTION πŸ’–

so the VFS_CHECKEXP() macro is what the NFS server uses to check if a mount point is exported to a client. that's it, that's the whole job. she's a vibe checker for exports πŸ’…

here's what she expects you to hand her:

  • mp β€” the mount point that's getting checked. the main character in question πŸ‘‘
  • nam β€” an mbuf containing the network address of the client. like, who's asking to get in 🫢
  • exflagsp β€” return parameter for the export flags for this client ✨
  • credanonp β€” return parameter for the anonymous credentials for this client πŸ™ˆ

so you call VFS_CHECKEXP() on a file system's mount structure to figure out if it's exported to a client whose address is sitting inside nam. no cap.

it's generally called before VFS_FHTOVP(9), so you can validate that a client actually has access to the file system. like, check the guest list before you let anyone in the door fr fr πŸšͺ

the file system should call vfs_export_lookup(9) with the address of an appropriate netexport structure and the address of the client, nam, to verify that the client can access this file system. that's the assignment. periodt.


⭐ RETURN VALUES ⭐

the export flags and the anonymous credentials specific to the client β€” the ones that come back from vfs_export_lookup(9) β€” get returned in *exflagsp and *credanonp. that's the tea, she hands you back your flags and your creds and you go about your day πŸ“


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Alfred Perlstein. thank you king 🫢


and that's the whole page babes πŸ’œ this little beauty came to you from Debian, dated January 4, 2010, filed under VFS_CHECKEXP(9) β€” yes she's been slaying since 2010, we love a legacy icon βœ¨πŸ’…πŸŒΈ

πŸ“¦ where this page comes from