diff --git a/include/spdk/scsi.h b/include/spdk/scsi.h index c70059a9ab..5bf155e044 100644 --- a/include/spdk/scsi.h +++ b/include/spdk/scsi.h @@ -124,7 +124,6 @@ struct spdk_scsi_task { uint32_t alloc_len; uint64_t offset; - struct iovec iov; struct spdk_scsi_task *parent; void (*free_fn)(struct spdk_scsi_task *); @@ -132,6 +131,10 @@ struct spdk_scsi_task { uint8_t *cdb; uint8_t *iobuf; + struct iovec iov; + struct iovec *iovs; + uint16_t iovcnt; + uint8_t sense_data[32]; size_t sense_data_len; diff --git a/lib/scsi/task.c b/lib/scsi/task.c index c0e39cabba..5ec2e3c9e5 100644 --- a/lib/scsi/task.c +++ b/lib/scsi/task.c @@ -88,6 +88,12 @@ spdk_scsi_task_construct(struct spdk_scsi_task *task, uint32_t *owner_task_ctr, task->owner_task_ctr = owner_task_ctr; *owner_task_ctr += 1; + /* + * Pre-fill the iov_buffers to point to the embedded iov + */ + task->iovs = &task->iov; + task->iovcnt = 1; + if (parent != NULL) { parent->ref++; task->parent = parent;