diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-09-05 20:31:42 -0400 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-03-23 17:15:31 -0400 |
commit | 2f477877f8c4be18f054aeb7c4be8cc748cfe932 (patch) | |
tree | ade275970fd1282cafc6d47753564c821020be8a /drivers/scsi/mpt2sas | |
parent | 4f2ac93c175c4922bdddbfec6cad94b32cea0070 (diff) |
block: Remove some unnecessary bi_vcnt usage
More prep work for immutable bvecs/effecient bio splitting - usage of
bi_vcnt has to be auditing, so getting rid of all the unnecessary usage
makes that easier.
Plus, bio_segments() is really what this code wanted, as it respects the
current value of bi_idx.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: Eric Moore <Eric.Moore@lsi.com>
CC: "James E.J. Bottomley" <JBottomley@parallels.com>
CC: linux-scsi@vger.kernel.org
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index 8c2ffbe6af0f..193e7ae90c3b 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -1939,7 +1939,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1939 | ioc->transport_cmds.status = MPT2_CMD_PENDING; | 1939 | ioc->transport_cmds.status = MPT2_CMD_PENDING; |
1940 | 1940 | ||
1941 | /* Check if the request is split across multiple segments */ | 1941 | /* Check if the request is split across multiple segments */ |
1942 | if (req->bio->bi_vcnt > 1) { | 1942 | if (bio_segments(req->bio) > 1) { |
1943 | u32 offset = 0; | 1943 | u32 offset = 0; |
1944 | 1944 | ||
1945 | /* Allocate memory and copy the request */ | 1945 | /* Allocate memory and copy the request */ |
@@ -1971,7 +1971,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1971 | 1971 | ||
1972 | /* Check if the response needs to be populated across | 1972 | /* Check if the response needs to be populated across |
1973 | * multiple segments */ | 1973 | * multiple segments */ |
1974 | if (rsp->bio->bi_vcnt > 1) { | 1974 | if (bio_segments(rsp->bio) > 1) { |
1975 | pci_addr_in = pci_alloc_consistent(ioc->pdev, blk_rq_bytes(rsp), | 1975 | pci_addr_in = pci_alloc_consistent(ioc->pdev, blk_rq_bytes(rsp), |
1976 | &pci_dma_in); | 1976 | &pci_dma_in); |
1977 | if (!pci_addr_in) { | 1977 | if (!pci_addr_in) { |
@@ -2038,7 +2038,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2038 | sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT | | 2038 | sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT | |
2039 | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); | 2039 | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); |
2040 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; | 2040 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; |
2041 | if (req->bio->bi_vcnt > 1) { | 2041 | if (bio_segments(req->bio) > 1) { |
2042 | ioc->base_add_sg_single(psge, sgl_flags | | 2042 | ioc->base_add_sg_single(psge, sgl_flags | |
2043 | (blk_rq_bytes(req) - 4), pci_dma_out); | 2043 | (blk_rq_bytes(req) - 4), pci_dma_out); |
2044 | } else { | 2044 | } else { |
@@ -2054,7 +2054,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2054 | MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | | 2054 | MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | |
2055 | MPI2_SGE_FLAGS_END_OF_LIST); | 2055 | MPI2_SGE_FLAGS_END_OF_LIST); |
2056 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; | 2056 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; |
2057 | if (rsp->bio->bi_vcnt > 1) { | 2057 | if (bio_segments(rsp->bio) > 1) { |
2058 | ioc->base_add_sg_single(psge, sgl_flags | | 2058 | ioc->base_add_sg_single(psge, sgl_flags | |
2059 | (blk_rq_bytes(rsp) + 4), pci_dma_in); | 2059 | (blk_rq_bytes(rsp) + 4), pci_dma_in); |
2060 | } else { | 2060 | } else { |
@@ -2099,7 +2099,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2099 | le16_to_cpu(mpi_reply->ResponseDataLength); | 2099 | le16_to_cpu(mpi_reply->ResponseDataLength); |
2100 | /* check if the resp needs to be copied from the allocated | 2100 | /* check if the resp needs to be copied from the allocated |
2101 | * pci mem */ | 2101 | * pci mem */ |
2102 | if (rsp->bio->bi_vcnt > 1) { | 2102 | if (bio_segments(rsp->bio) > 1) { |
2103 | u32 offset = 0; | 2103 | u32 offset = 0; |
2104 | u32 bytes_to_copy = | 2104 | u32 bytes_to_copy = |
2105 | le16_to_cpu(mpi_reply->ResponseDataLength); | 2105 | le16_to_cpu(mpi_reply->ResponseDataLength); |