isci: unify request data structures
Make scic_sds_request a proper member of isci_request. Also let's us
get rid of the dma pool object size tracking since we now know that all
requests are sizeof(isci_request). While cleaning up the construct
routine incidentally replaced SCI_FIELD_OFFSET with offsetof.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h
index ddfbf71..89d8b0a 100644
--- a/drivers/scsi/isci/request.h
+++ b/drivers/scsi/isci/request.h
@@ -82,11 +82,11 @@
};
struct isci_request {
- struct scic_sds_request *sci_request_handle;
enum isci_request_status status;
enum task_type ttype;
unsigned short io_tag;
bool complete_in_target;
+ bool terminated;
union ttype_ptr_union {
struct sas_task *io_task_ptr; /* When ttype==io_task */
@@ -103,7 +103,6 @@
dma_addr_t zero_scatter_daddr;
unsigned int num_sg_entries; /* returned by pci_alloc_sg */
- unsigned int request_alloc_size; /* size of block from dma_pool_alloc */
/** Note: "io_request_completion" is completed in two different ways
* depending on whether this is a TMF or regular request.
@@ -115,9 +114,16 @@
* TMF was aborting is guaranteed to have completed.
*/
struct completion *io_request_completion;
- struct scic_sds_request sci_req[0] ____cacheline_aligned;
+ struct scic_sds_request sci;
};
+static inline struct isci_request *sci_req_to_ireq(struct scic_sds_request *sci_req)
+{
+ struct isci_request *ireq = container_of(sci_req, typeof(*ireq), sci);
+
+ return ireq;
+}
+
/**
* This function gets the status of the request object.
* @request: This parameter points to the isci_request object