From mboxrd@z Thu Jan 1 00:00:00 1970 From: Douglas Gilbert Date: Thu, 18 Jan 2001 21:08:36 +0000 Subject: Re: SCSI Patches - mostly on/off-line stuff Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org David Brownell wrote: > > It seemed to me that something was missing in that stack though; > the layers above (4), specifically filesystems, that would also need > to know about new devices that were added. When everything is > working smoothly, users need to see filesystems get mounted as > a direct consequence of hotplugging such storage units. > > One way to look at that issue is to ask what user mode notifications > will be used to address that part of the hotplug problem. Devfsd > is what some folk like, but it's not universally accepted. GUI > driven solutions don't seem right in all cases either. > [snip] Devfs has the useful property that only devices that are present and have their drivers ready appear in the /dev hierarchy. In the case of SCSI devices, devfs maintains this dynamically via calls in the _attach() and _detach() functions within the upper level drivers. The new directory notification capability in lk 2.4 (see Documentation/dnotify.txt) could then be used to detect changes in the /dev directory (or below). A user mode notification daemon could read /proc/scsi/scsi periodically to detect the arrival and departure of SCSI (pseudo) devices. To this end, the output read from /proc/scsi/sg/devices would be easier to parse. If a cdrom drive has just be introduced, it would relatively easy to work out which /dev/sr device name it was. I guess existing cdrom applications would then be smart enough to work out whether the drive was empty, had a music cd, or a data cdrom (which fs type, etc). Currently there is a boolean flag: 'emulated' that sg can yield via an ioctl and is available in /proc/scsi/sg/hosts . I assume it was introduced for the first pseudo scsi driver: ide-scsi. Seems to me that this flag could be expanded to be the major device number of the primary protocol stack that a pseudo SCSI device belongs to (e.g. IDE, USB, IEEE1394 etc). This would allow a user mode notification daemon to cross reference the primary protocol stack. Doug Gilbert _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel