Re: Devd event from GEOM?

From: Robert Watson <rwatson_at_freebsd.org>
Date: Tue, 25 Jan 2005 17:01:27 +0000 (GMT)
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
Received on Tue Jan 25 2005 - 16:01:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC