From owner-freebsd-hackers Thu Feb 2 04:55:26 1995 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id EAA02599 for hackers-outgoing; Thu, 2 Feb 1995 04:55:26 -0800 Received: from bambam.cs.city.ac.uk (bambam.cs.city.ac.uk [138.40.91.91]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id EAA02587 for ; Thu, 2 Feb 1995 04:55:13 -0800 Received: by bambam.cs.city.ac.uk (Smail3.1.28.1 #14) id m0ra0zs-0000xfC; Thu, 2 Feb 95 12:50 GMT To: citycs-list-freebsd-hackers@cs.city.ac.uk Path: usenet From: njw@sarc.city.ac.uk (unknown) Newsgroups: citycs.list.freebsd.hackers Subject: Re: Am I dreaming? Date: 02 Feb 1995 12:50:43 GMT Organization: Systems Architecture Research Centre, City University Lines: 35 Message-ID: References: <3gpv4m$5hf@bambam.cs.city.ac.uk> NNTP-Posting-Host: ghost.sarc.city.ac.uk In-reply-to: "Jordan K. Hubbard"'s message of 2 Feb 1995 06:46:46 -0000 Sender: hackers-owner@FreeBSD.org Precedence: bulk In article <3gpv4m$5hf@bambam.cs.city.ac.uk> "Jordan K. Hubbard" writes: > I think the question was more one of how it get its mitts on user > requests for files that aren't currently mounted. Amd mounts itself into the fs namespace as an NFS server. Whenever the filesystem hits the mountpoint, it sends the request off to the registered NFS server (amd) asking for a filehandle. Amd then does magic and returns the filehandle, or a code like ENOENT. The magic is basically: if amd has already got an idea of what to do with the file, then it can return the filehandle straight away. If, however, the amdmap resolves to a filesystem not currently mounted, amd forks off a new process to do the mount (ensuring the master doesn't get blocked on remote NFS requests). It mounts the new filesystem into a semi-private area of the filesystem (designed in such a way as to prevent processes from hanging in NFS waits due to the awful but mostly neccessary implementation of getcwd()) and then returns a filehandle which is a symlink into the real mountpoint. To ensure things work as expected, amd continually sends NFS no-op RPCs (in effect, pings) to each of the fileservers in use to determine their "upness". Based on it's knowledge of whether or not a fileserver is up, amd can also return ENOENT to a file if, in theory it's available, but in reality the server is dead. In this case, it can also use any alternative fileservers specified in the mountmap. There you go. -- Web: http://web.cs.city.ac.uk/finger/njw E-mail: njw@sarc.city.ac.uk (MIME and ATK) Work Telephone: +44 71 477 8551 Work Fax: +44 71 477 8587