mountd ^^^^^^ See man rpc.mountd for basic info. work of MNT done by utils/mountd/mountd.c:get_rootfh(): first calls utils/mountd/auth.c:auth_reload(): first frees everything with export_freeall. Then xtab_read(_PATH_ETAB): read /var/lib/nfs/etab, the list of current exports, using: getexportent: fill in a struct exportent, which includes hostname, path, etc. export_lookup: takes exportent, looks up struct nfs_export, which is an exportent plus a pointer to a struct mclient (which includes type, addresses, etc.) export_create: creates exportent both export_lookup and _create do a client_lookup, which creates a new client if required and does all the name lookups and such. Then do utils/mountd/auth.c:auth_authenticate(): does auth_authenticate_internal() on the path, then on the path minus the last component, etc., till it finds an export. auth_authenticate_internal(): does DNS stuff, then export_find, which does for each export an export_check, which compares path and does client_check(), which is what does wildcard matching and all the rest. stat path, make sure it's a directory or regular file. export_export(): does the actual nfsctls as necessary. xtab_append(): appends entry to xtab file. (What's that for?) getfh_size(): does an nfsctl to get the filehandle. mountlist_add(): adds to rmtab. export_reset(): don't understand this.