/* Abort all outstanding requests. This is only safe to use if the completion ring will never be walked again or the device has been reset, because it destroys the 1-1 mapping between context field passed to emulation and our request structure.  */
static void pvscsi_reset_all(struct pvscsi_adapter *adapter)
/* Abort all outstanding requests. This is only safe to use if the completion ring will never be walked again or the device has been reset, because it destroys the 1-1 mapping between context field passed to emulation and our request structure.  */
static void pvscsi_reset_all(struct pvscsi_adapter *adapter)
{
	unsigned i;
	for (i = 0; i < adapter->req_depth; i++) {
		struct pvscsi_ctx *ctx = &adapter->cmd_map[i];
		struct scsi_cmnd *cmd = ctx->cmd;
		if (cmd) {
			scmd_printk(KERN_ERR, cmd,
				    "Forced reset on cmd %p\n", cmd);
			pvscsi_unmap_buffers(adapter, ctx);
			pvscsi_release_context(adapter, ctx);
			cmd->result = (DID_RESET << 16);
			cmd->scsi_done(cmd);
		}
	}
}