Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 1996 17:52:34 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        Brett_Glass@ccgate.infoworld.com (Brett Glass)
Cc:        msmith@atrad.adelaide.edu.au, jkh@time.cdrom.com, hardware@freebsd.org
Subject:   Re: Some solutions to disk problems.... I think.
Message-ID:  <199604040822.RAA26522@genesis.atrad.adelaide.edu.au>
In-Reply-To: <9603038286.AA828600274@ccgate.infoworld.com> from "Brett Glass" at Apr 3, 96 11:40:32 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Brett Glass stands accused of saying:
> 
> > *sigh*  The whole point is that _nothing_ other than the 'wd' driver
> > should know this;
> 
> Why not? When a tape drive or CD-ROM is attached to a SCSI interface, there
> are exposed flags for both the SCSI adapter and the drive. This isn't
> "special case" code.

Er, no there aren't any exposed flags for the device.  SCSI devices
are dynamically allocated at probe time, much too late for something
like userconfig() to be of use.

> Thus making the table larger than intelligent recognition code. Even
> wildcards aren't enough to solve the problem. (Regular expressions WOULD
> be, but I don't think there's much justification for adding a regular
> expression matcher to the kernel!)

Here's a suggestion.  Write a function that performs simple string matching
using a table of ten IDs.  Write ten functions which each parse for these
ID's.  Compare the size of the two.  Repeat the process for twenty, and so
on.  You may be unpleasantly surprised.  Note that your functions will have
to have the relevant text embedded _anyway_, so there's no way you can win 8)

> The contents of the ID string may need to be parsed further. At which
> point, one will need code anyway.

For what?  It matches, or it doesn't.  If it matches, it has the noted
behaviour.  If it doesn't, it doesn't.  KISS.

> --Brett

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 0411-222-496       [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] Collector of old Unix hardware.      "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604040822.RAA26522>