From 67ea838d17acdad3331aeae848683c768df96aaa Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 8 May 2011 11:47:15 -0700 Subject: 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 Signed-off-by: Dan Williams --- drivers/scsi/isci/request.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/isci/request.h') diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h index ddfbf71c97e5..89d8b0a27dfe 100644 --- a/drivers/scsi/isci/request.h +++ b/drivers/scsi/isci/request.h @@ -82,11 +82,11 @@ enum task_type { }; 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 @@ struct isci_request { 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 @@ struct isci_request { * 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 -- cgit