[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#267227: Minor efficiency improvement for scsi device search



reopen 267227 
thanks

Hi, 

(aside from my initial non-optimal code which misses USB-floppy which I
do not have...)

I think I was not verbose enough to point out the issues in the code
first.  The following are shell interaction record during RC1 booting
process on my system where no floppy disk exists and USB memory key
device is plugged in:

~ # echo /dev/floppy/?
/dev/floppy/?
~ # find /dev/scsi
/dev/scsi
/dev/scsi/host0
/dev/scsi/host0/bus0
/dev/scsi/host0/bus0/target0
/dev/scsi/host0/bus0/target0/lun0
/dev/scsi/host0/bus0/target0/lun0/disc
/dev/scsi/host0/bus0/target0/lun0/part1
~ # 

Code is optimized not to look all the possible scsi devices but still
has some useless devices listed, as I saw and played in the shell as
above.

After a while I also thought about possibility of USB floppy too and
used following commanads to find he devices to store log with my version
of bugreporter-udeb.

~ # find /dev/floppy -type b
~ # find /dev/scsi -type b
/dev/scsi/host0/bus0/target0/lun0/disc
/dev/scsi/host0/bus0/target0/lun0/part1
~ # 

I think advantage of "find /dev/floppy -type b" over "echo
/dev/floppy/?" is small but latter is good idea since we invoke "find"
anyway.  I did check udeb version of "find" having -type support as I
indicated above.

If mounting these entries like "/dev/floppy/?" and "/dev/scsi" was
intentional KISS, please close this report again.

On Fri, Aug 27, 2004 at 12:30:44PM -0400, Joey Hess wrote:
> Osamu Aoki wrote:
> > When playing with bugreporter-udeb, I had a good look at init code
> > in this package's src-bootfloppy directory.
> > 
> >   find /dev/scsi
> > 
> > This list many useless entries.  Assuming no one wish to use partition 
> > after part9, changing above with
> > 
> >   find /dev/scsi -name 'part?'||true
> > 
> > may improve code.  (Or I should say, I did so in bugreporter-udeb.)
> > 
> > Does this make sense or it is bad idea.  If bad tell me so.  Then I will
> > fix bugreporter-udeb patch too.
> 
> This won't work because floppies rarely have partitions on them at all.
> Also, KISS applies. And since devfs only creates part* entries for
> existing partitions, the code is already optimised.

I overlooked USB floppy.

> (I'd suggest testing code before sending in patches.)

Sorry, I may have given impression like this but this is not the case
for this one.  I will be careful, though.

Cheers,

Osamu




Reply to: