>>>>> "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. I have some changes in the pipeline to better support protection interleaving in DIF Type 2. I was contemplating renaming scsi_get_lba() to scsi_get_reference_tag() or something to that effect. As as for the reason scsi_get_lba() looks at the start sector directly: I was simply trying to avoid growing struct scsi_cmnd. The "correct" thing would have been to add an initial reference tag field to scsi_cmnd and have that be filled out by sd_prot_op(). -- Martin K. Petersen Oracle Linux Engineering -- 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