On Wed, 02 Jun 2010 09:13:51 -0400 "Martin K. Petersen" <martin.petersen@xxxxxxxxxx> wrote: > >>>>> "Tomo" == FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> writes: > > >> scsi LLDs can be pass-through for disks, as well as lots of other > >> type of devices. They should not assume the role of a disk. The use > >> of blk_rq_pos() at LLDs is probably wrong in the first place. Unless > >> it is some kind of scsi emulation driver like scsi_debug. > > Tomo> Not only scsi_debug. Have you seen how scsi_get_lba() is used? > Tomo> LLDs sometime needs to know lba in scsi commands. > > scsi_get_lba() is used by DIX/DIF-aware HBA drivers to get the first LBA > for use in reference tag verification/preparation. > > This code path is only executed by the drivers if the command protection > mode is > SCSI_PROT_NORMAL which can only be true for a READ/WRITE > command. I don't see any drivers using it for other purposes. Yeah, however, seems that there are several drivers that get lba and sector info from cdb. Some does it for something like statistics, debug printk, etc. Some does it to build hardware descriptor (e.g. 3w, megaraid, several drivers in usb/storage/, etc). So it would be useful to have scsi_get_lba() that always works, I think. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html