• Martin Dalecki's avatar
    [PATCH] 2.5.17 IDE 66 · 6b4fef7a
    Martin Dalecki authored
     - Move ll_10byte_cmd_build to the only place where it's used: ide-cd.  The SCSI
       layer does have it's own implementation which additionally it's messing
       around with the hard_nr_sectors struct request value.  One should *not*
       provide "infrastructure" until its really used as such.
    
       If anywhere this should reside in a file called ATAPI.
    
     - Unfold the INIT_REQUEST macro from blk.h. This showed up plenty of duplicate
       checks for QUEUE_EMPTY. Clean them as well. Remove the over cautious
       major(CURRENT->rq_dev != MAJOR_NR) checks. During the last several years I
       never saw any report about it. Looking at the !CURRENT->bio it is clear that
       dereferencing NULL will provide the same kind of panic as the check.  Some
       comments around the code in question show nicely that indeed INIT_REQUEST
       was a good example of code obfuscation.
    
     - A short look at RQ_INACTIVE shows that it is only used inside the scsi.c file
       and during the removal of devices. This shows that the many checks for
       RQ_INACTIVE are not necessary. Looking closer even shows that some of them
       did happen before checks for an empty queue. Plenty of drivers didn't care
       about it and the CD-ROM ones should be handled properly, because the
       most common drivers would fail as well. Comments indicate that this
       was an leftover from 1.3 days...
    6b4fef7a
ftl.c 37.9 KB