I like this idea, but..
> -void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd)
> +void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd,
> + struct scsi_data_buffer *prot_sdb)
> {
> void *buf = cmd->sense_buffer;
> - void *prot = cmd->prot_sdb;
> unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA;
>
> /* zero out the cmd, except for the embedded scsi_request */
> @@ -1164,7 +1164,7 @@ void scsi_init_command(struct scsi_device *dev, struct
> scsi_cmnd *cmd)
>
> cmd->device = dev;
> cmd->sense_buffer = buf;
> - cmd->prot_sdb = prot;
> + cmd->prot_sdb = prot_sdb;
What would be the problem of always preserving the original prot_sdb
value instead of passing it by argument? You;d just need to initialize
it in scsi_init_request when the command is allocated.