From owner-freebsd-current@FreeBSD.ORG Tue Jan 25 17:01:56 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5B1A16A4CE for ; Tue, 25 Jan 2005 17:01:56 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D93743D1D for ; Tue, 25 Jan 2005 17:01:56 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id j0PH1R9P006256; Tue, 25 Jan 2005 12:01:27 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)j0PH1ROe006253; Tue, 25 Jan 2005 17:01:27 GMT (envelope-from robert@fledge.watson.org) Date: Tue, 25 Jan 2005 17:01:27 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Warner Losh In-Reply-To: <20050125.095019.71141844.imp@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: pete@altadena.net cc: current@freebsd.org cc: imp@bsdimp.com Subject: Re: Devd event from GEOM? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 17:01:57 -0000 On Tue, 25 Jan 2005, Warner Losh wrote: > > each abstraction layer can declare the events it knows about. newbus > > announces "I found a route to a physical device", GEOM shouts "And I found > > some storage space on it", etc. > > Actually, GEOM will announce all the layers as well, since it is an > onion sort of thing. For the degenerate case of FAT on FLASH Stick, it > is easy, because you don't see the layers. But I routinely plug in CF > cards that have FreeBSD file systems on them, as well as an emergency > DOS partition. Those sort of cases make whatever automounting daemon > need to grow a lot of brains, and will have multiple events. A simple auto-mounter simply watches for every storage device that arrives via GEOM, checks to see if it's leaf class, and if it is, tastes for a file system header, auto-detecting some of the simple and common types, such as FAT, UFS, UFS2, cd9660. It can then use whatever logic it pleases, probably partly from a config file, to decide where to mount it, what security parameters to use, etc. Here-in lies the key: because devd says "a storage device, /dev/ad0s1a arrived", it knows it can just go ahead and taste, not worrying about rewinding the tape, reading from kernel memory, etc. The auto-mounter specifically wants to hear only about GEOMs. Robert N M Watson