diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-30 14:19:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-30 14:19:05 -0500 |
commit | f568849edac8611d603e00bd6cbbcfea09395ae6 (patch) | |
tree | b9472d640fe5d87426d38c9d81d946cf197ad3fb /drivers/scsi | |
parent | d9894c228b11273e720bb63ba120d1d326fe9d94 (diff) | |
parent | 675675ada486dde5bf9aa51665e90706bff11a35 (diff) |
Merge branch 'for-3.14/core' of git://git.kernel.dk/linux-block
Pull core block IO changes from Jens Axboe:
"The major piece in here is the immutable bio_ve series from Kent, the
rest is fairly minor. It was supposed to go in last round, but
various issues pushed it to this release instead. The pull request
contains:
- Various smaller blk-mq fixes from different folks. Nothing major
here, just minor fixes and cleanups.
- Fix for a memory leak in the error path in the block ioctl code
from Christian Engelmayer.
- Header export fix from CaiZhiyong.
- Finally the immutable biovec changes from Kent Overstreet. This
enables some nice future work on making arbitrarily sized bios
possible, and splitting more efficient. Related fixes to immutable
bio_vecs:
- dm-cache immutable fixup from Mike Snitzer.
- btrfs immutable fixup from Muthu Kumar.
- bio-integrity fix from Nic Bellinger, which is also going to stable"
* 'for-3.14/core' of git://git.kernel.dk/linux-block: (44 commits)
xtensa: fixup simdisk driver to work with immutable bio_vecs
block/blk-mq-cpu.c: use hotcpu_notifier()
blk-mq: for_each_* macro correctness
block: Fix memory leak in rw_copy_check_uvector() handling
bio-integrity: Fix bio_integrity_verify segment start bug
block: remove unrelated header files and export symbol
blk-mq: uses page->list incorrectly
blk-mq: use __smp_call_function_single directly
btrfs: fix missing increment of bi_remaining
Revert "block: Warn and free bio if bi_end_io is not set"
block: Warn and free bio if bi_end_io is not set
blk-mq: fix initializing request's start time
block: blk-mq: don't export blk_mq_free_queue()
block: blk-mq: make blk_sync_queue support mq
block: blk-mq: support draining mq queue
dm cache: increment bi_remaining when bi_end_io is restored
block: fixup for generic bio chaining
block: Really silence spurious compiler warnings
block: Silence spurious compiler warnings
block: Kill bio_pair_split()
...
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 8 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 41 | ||||
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_transport.c | 39 | ||||
-rw-r--r-- | drivers/scsi/osd/osd_initiator.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sd_dif.c | 30 |
6 files changed, 63 insertions, 59 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 446b85110a1f..0cac7d8fd0f7 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -2163,10 +2163,10 @@ int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | /* do we need to support multiple segments? */ | 2165 | /* do we need to support multiple segments? */ |
2166 | if (bio_segments(req->bio) > 1 || bio_segments(rsp->bio) > 1) { | 2166 | if (bio_multiple_segments(req->bio) || |
2167 | printk("%s: multiple segments req %u %u, rsp %u %u\n", | 2167 | bio_multiple_segments(rsp->bio)) { |
2168 | __func__, bio_segments(req->bio), blk_rq_bytes(req), | 2168 | printk("%s: multiple segments req %u, rsp %u\n", |
2169 | bio_segments(rsp->bio), blk_rq_bytes(rsp)); | 2169 | __func__, blk_rq_bytes(req), blk_rq_bytes(rsp)); |
2170 | return -EINVAL; | 2170 | return -EINVAL; |
2171 | } | 2171 | } |
2172 | 2172 | ||
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index 9d26637308be..410f4a3e8888 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -1901,7 +1901,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1901 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 1901 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
1902 | Mpi2SmpPassthroughRequest_t *mpi_request; | 1902 | Mpi2SmpPassthroughRequest_t *mpi_request; |
1903 | Mpi2SmpPassthroughReply_t *mpi_reply; | 1903 | Mpi2SmpPassthroughReply_t *mpi_reply; |
1904 | int rc, i; | 1904 | int rc; |
1905 | u16 smid; | 1905 | u16 smid; |
1906 | u32 ioc_state; | 1906 | u32 ioc_state; |
1907 | unsigned long timeleft; | 1907 | unsigned long timeleft; |
@@ -1916,7 +1916,8 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1916 | void *pci_addr_out = NULL; | 1916 | void *pci_addr_out = NULL; |
1917 | u16 wait_state_count; | 1917 | u16 wait_state_count; |
1918 | struct request *rsp = req->next_rq; | 1918 | struct request *rsp = req->next_rq; |
1919 | struct bio_vec *bvec = NULL; | 1919 | struct bio_vec bvec; |
1920 | struct bvec_iter iter; | ||
1920 | 1921 | ||
1921 | if (!rsp) { | 1922 | if (!rsp) { |
1922 | printk(MPT2SAS_ERR_FMT "%s: the smp response space is " | 1923 | printk(MPT2SAS_ERR_FMT "%s: the smp response space is " |
@@ -1942,7 +1943,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1942 | ioc->transport_cmds.status = MPT2_CMD_PENDING; | 1943 | ioc->transport_cmds.status = MPT2_CMD_PENDING; |
1943 | 1944 | ||
1944 | /* Check if the request is split across multiple segments */ | 1945 | /* Check if the request is split across multiple segments */ |
1945 | if (bio_segments(req->bio) > 1) { | 1946 | if (bio_multiple_segments(req->bio)) { |
1946 | u32 offset = 0; | 1947 | u32 offset = 0; |
1947 | 1948 | ||
1948 | /* Allocate memory and copy the request */ | 1949 | /* Allocate memory and copy the request */ |
@@ -1955,11 +1956,11 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1955 | goto out; | 1956 | goto out; |
1956 | } | 1957 | } |
1957 | 1958 | ||
1958 | bio_for_each_segment(bvec, req->bio, i) { | 1959 | bio_for_each_segment(bvec, req->bio, iter) { |
1959 | memcpy(pci_addr_out + offset, | 1960 | memcpy(pci_addr_out + offset, |
1960 | page_address(bvec->bv_page) + bvec->bv_offset, | 1961 | page_address(bvec.bv_page) + bvec.bv_offset, |
1961 | bvec->bv_len); | 1962 | bvec.bv_len); |
1962 | offset += bvec->bv_len; | 1963 | offset += bvec.bv_len; |
1963 | } | 1964 | } |
1964 | } else { | 1965 | } else { |
1965 | dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), | 1966 | dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), |
@@ -1974,7 +1975,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1974 | 1975 | ||
1975 | /* Check if the response needs to be populated across | 1976 | /* Check if the response needs to be populated across |
1976 | * multiple segments */ | 1977 | * multiple segments */ |
1977 | if (bio_segments(rsp->bio) > 1) { | 1978 | if (bio_multiple_segments(rsp->bio)) { |
1978 | pci_addr_in = pci_alloc_consistent(ioc->pdev, blk_rq_bytes(rsp), | 1979 | pci_addr_in = pci_alloc_consistent(ioc->pdev, blk_rq_bytes(rsp), |
1979 | &pci_dma_in); | 1980 | &pci_dma_in); |
1980 | if (!pci_addr_in) { | 1981 | if (!pci_addr_in) { |
@@ -2041,7 +2042,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2041 | sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT | | 2042 | sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT | |
2042 | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); | 2043 | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); |
2043 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; | 2044 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; |
2044 | if (bio_segments(req->bio) > 1) { | 2045 | if (bio_multiple_segments(req->bio)) { |
2045 | ioc->base_add_sg_single(psge, sgl_flags | | 2046 | ioc->base_add_sg_single(psge, sgl_flags | |
2046 | (blk_rq_bytes(req) - 4), pci_dma_out); | 2047 | (blk_rq_bytes(req) - 4), pci_dma_out); |
2047 | } else { | 2048 | } else { |
@@ -2057,7 +2058,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2057 | MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | | 2058 | MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | |
2058 | MPI2_SGE_FLAGS_END_OF_LIST); | 2059 | MPI2_SGE_FLAGS_END_OF_LIST); |
2059 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; | 2060 | sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; |
2060 | if (bio_segments(rsp->bio) > 1) { | 2061 | if (bio_multiple_segments(rsp->bio)) { |
2061 | ioc->base_add_sg_single(psge, sgl_flags | | 2062 | ioc->base_add_sg_single(psge, sgl_flags | |
2062 | (blk_rq_bytes(rsp) + 4), pci_dma_in); | 2063 | (blk_rq_bytes(rsp) + 4), pci_dma_in); |
2063 | } else { | 2064 | } else { |
@@ -2102,23 +2103,23 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2102 | le16_to_cpu(mpi_reply->ResponseDataLength); | 2103 | le16_to_cpu(mpi_reply->ResponseDataLength); |
2103 | /* check if the resp needs to be copied from the allocated | 2104 | /* check if the resp needs to be copied from the allocated |
2104 | * pci mem */ | 2105 | * pci mem */ |
2105 | if (bio_segments(rsp->bio) > 1) { | 2106 | if (bio_multiple_segments(rsp->bio)) { |
2106 | u32 offset = 0; | 2107 | u32 offset = 0; |
2107 | u32 bytes_to_copy = | 2108 | u32 bytes_to_copy = |
2108 | le16_to_cpu(mpi_reply->ResponseDataLength); | 2109 | le16_to_cpu(mpi_reply->ResponseDataLength); |
2109 | bio_for_each_segment(bvec, rsp->bio, i) { | 2110 | bio_for_each_segment(bvec, rsp->bio, iter) { |
2110 | if (bytes_to_copy <= bvec->bv_len) { | 2111 | if (bytes_to_copy <= bvec.bv_len) { |
2111 | memcpy(page_address(bvec->bv_page) + | 2112 | memcpy(page_address(bvec.bv_page) + |
2112 | bvec->bv_offset, pci_addr_in + | 2113 | bvec.bv_offset, pci_addr_in + |
2113 | offset, bytes_to_copy); | 2114 | offset, bytes_to_copy); |
2114 | break; | 2115 | break; |
2115 | } else { | 2116 | } else { |
2116 | memcpy(page_address(bvec->bv_page) + | 2117 | memcpy(page_address(bvec.bv_page) + |
2117 | bvec->bv_offset, pci_addr_in + | 2118 | bvec.bv_offset, pci_addr_in + |
2118 | offset, bvec->bv_len); | 2119 | offset, bvec.bv_len); |
2119 | bytes_to_copy -= bvec->bv_len; | 2120 | bytes_to_copy -= bvec.bv_len; |
2120 | } | 2121 | } |
2121 | offset += bvec->bv_len; | 2122 | offset += bvec.bv_len; |
2122 | } | 2123 | } |
2123 | } | 2124 | } |
2124 | } else { | 2125 | } else { |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index e771a88c6a74..65170cb1a00f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c | |||
@@ -1884,7 +1884,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1884 | struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); | 1884 | struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
1885 | Mpi2SmpPassthroughRequest_t *mpi_request; | 1885 | Mpi2SmpPassthroughRequest_t *mpi_request; |
1886 | Mpi2SmpPassthroughReply_t *mpi_reply; | 1886 | Mpi2SmpPassthroughReply_t *mpi_reply; |
1887 | int rc, i; | 1887 | int rc; |
1888 | u16 smid; | 1888 | u16 smid; |
1889 | u32 ioc_state; | 1889 | u32 ioc_state; |
1890 | unsigned long timeleft; | 1890 | unsigned long timeleft; |
@@ -1898,7 +1898,8 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1898 | void *pci_addr_out = NULL; | 1898 | void *pci_addr_out = NULL; |
1899 | u16 wait_state_count; | 1899 | u16 wait_state_count; |
1900 | struct request *rsp = req->next_rq; | 1900 | struct request *rsp = req->next_rq; |
1901 | struct bio_vec *bvec = NULL; | 1901 | struct bio_vec bvec; |
1902 | struct bvec_iter iter; | ||
1902 | 1903 | ||
1903 | if (!rsp) { | 1904 | if (!rsp) { |
1904 | pr_err(MPT3SAS_FMT "%s: the smp response space is missing\n", | 1905 | pr_err(MPT3SAS_FMT "%s: the smp response space is missing\n", |
@@ -1925,7 +1926,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1925 | ioc->transport_cmds.status = MPT3_CMD_PENDING; | 1926 | ioc->transport_cmds.status = MPT3_CMD_PENDING; |
1926 | 1927 | ||
1927 | /* Check if the request is split across multiple segments */ | 1928 | /* Check if the request is split across multiple segments */ |
1928 | if (req->bio->bi_vcnt > 1) { | 1929 | if (bio_multiple_segments(req->bio)) { |
1929 | u32 offset = 0; | 1930 | u32 offset = 0; |
1930 | 1931 | ||
1931 | /* Allocate memory and copy the request */ | 1932 | /* Allocate memory and copy the request */ |
@@ -1938,11 +1939,11 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1938 | goto out; | 1939 | goto out; |
1939 | } | 1940 | } |
1940 | 1941 | ||
1941 | bio_for_each_segment(bvec, req->bio, i) { | 1942 | bio_for_each_segment(bvec, req->bio, iter) { |
1942 | memcpy(pci_addr_out + offset, | 1943 | memcpy(pci_addr_out + offset, |
1943 | page_address(bvec->bv_page) + bvec->bv_offset, | 1944 | page_address(bvec.bv_page) + bvec.bv_offset, |
1944 | bvec->bv_len); | 1945 | bvec.bv_len); |
1945 | offset += bvec->bv_len; | 1946 | offset += bvec.bv_len; |
1946 | } | 1947 | } |
1947 | } else { | 1948 | } else { |
1948 | dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), | 1949 | dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), |
@@ -1957,7 +1958,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1957 | 1958 | ||
1958 | /* Check if the response needs to be populated across | 1959 | /* Check if the response needs to be populated across |
1959 | * multiple segments */ | 1960 | * multiple segments */ |
1960 | if (rsp->bio->bi_vcnt > 1) { | 1961 | if (bio_multiple_segments(rsp->bio)) { |
1961 | pci_addr_in = pci_alloc_consistent(ioc->pdev, blk_rq_bytes(rsp), | 1962 | pci_addr_in = pci_alloc_consistent(ioc->pdev, blk_rq_bytes(rsp), |
1962 | &pci_dma_in); | 1963 | &pci_dma_in); |
1963 | if (!pci_addr_in) { | 1964 | if (!pci_addr_in) { |
@@ -2018,7 +2019,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2018 | mpi_request->RequestDataLength = cpu_to_le16(blk_rq_bytes(req) - 4); | 2019 | mpi_request->RequestDataLength = cpu_to_le16(blk_rq_bytes(req) - 4); |
2019 | psge = &mpi_request->SGL; | 2020 | psge = &mpi_request->SGL; |
2020 | 2021 | ||
2021 | if (req->bio->bi_vcnt > 1) | 2022 | if (bio_multiple_segments(req->bio)) |
2022 | ioc->build_sg(ioc, psge, pci_dma_out, (blk_rq_bytes(req) - 4), | 2023 | ioc->build_sg(ioc, psge, pci_dma_out, (blk_rq_bytes(req) - 4), |
2023 | pci_dma_in, (blk_rq_bytes(rsp) + 4)); | 2024 | pci_dma_in, (blk_rq_bytes(rsp) + 4)); |
2024 | else | 2025 | else |
@@ -2063,23 +2064,23 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2063 | 2064 | ||
2064 | /* check if the resp needs to be copied from the allocated | 2065 | /* check if the resp needs to be copied from the allocated |
2065 | * pci mem */ | 2066 | * pci mem */ |
2066 | if (rsp->bio->bi_vcnt > 1) { | 2067 | if (bio_multiple_segments(rsp->bio)) { |
2067 | u32 offset = 0; | 2068 | u32 offset = 0; |
2068 | u32 bytes_to_copy = | 2069 | u32 bytes_to_copy = |
2069 | le16_to_cpu(mpi_reply->ResponseDataLength); | 2070 | le16_to_cpu(mpi_reply->ResponseDataLength); |
2070 | bio_for_each_segment(bvec, rsp->bio, i) { | 2071 | bio_for_each_segment(bvec, rsp->bio, iter) { |
2071 | if (bytes_to_copy <= bvec->bv_len) { | 2072 | if (bytes_to_copy <= bvec.bv_len) { |
2072 | memcpy(page_address(bvec->bv_page) + | 2073 | memcpy(page_address(bvec.bv_page) + |
2073 | bvec->bv_offset, pci_addr_in + | 2074 | bvec.bv_offset, pci_addr_in + |
2074 | offset, bytes_to_copy); | 2075 | offset, bytes_to_copy); |
2075 | break; | 2076 | break; |
2076 | } else { | 2077 | } else { |
2077 | memcpy(page_address(bvec->bv_page) + | 2078 | memcpy(page_address(bvec.bv_page) + |
2078 | bvec->bv_offset, pci_addr_in + | 2079 | bvec.bv_offset, pci_addr_in + |
2079 | offset, bvec->bv_len); | 2080 | offset, bvec.bv_len); |
2080 | bytes_to_copy -= bvec->bv_len; | 2081 | bytes_to_copy -= bvec.bv_len; |
2081 | } | 2082 | } |
2082 | offset += bvec->bv_len; | 2083 | offset += bvec.bv_len; |
2083 | } | 2084 | } |
2084 | } | 2085 | } |
2085 | } else { | 2086 | } else { |
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index aa66361ed44b..bac04c2335aa 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c | |||
@@ -731,7 +731,7 @@ static int _osd_req_list_objects(struct osd_request *or, | |||
731 | 731 | ||
732 | bio->bi_rw &= ~REQ_WRITE; | 732 | bio->bi_rw &= ~REQ_WRITE; |
733 | or->in.bio = bio; | 733 | or->in.bio = bio; |
734 | or->in.total_bytes = bio->bi_size; | 734 | or->in.total_bytes = bio->bi_iter.bi_size; |
735 | return 0; | 735 | return 0; |
736 | } | 736 | } |
737 | 737 | ||
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 9846c6ab2aaa..470954aba728 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -801,7 +801,7 @@ static int sd_setup_write_same_cmnd(struct scsi_device *sdp, struct request *rq) | |||
801 | if (sdkp->device->no_write_same) | 801 | if (sdkp->device->no_write_same) |
802 | return BLKPREP_KILL; | 802 | return BLKPREP_KILL; |
803 | 803 | ||
804 | BUG_ON(bio_offset(bio) || bio_iovec(bio)->bv_len != sdp->sector_size); | 804 | BUG_ON(bio_offset(bio) || bio_iovec(bio).bv_len != sdp->sector_size); |
805 | 805 | ||
806 | sector >>= ilog2(sdp->sector_size) - 9; | 806 | sector >>= ilog2(sdp->sector_size) - 9; |
807 | nr_sectors >>= ilog2(sdp->sector_size) - 9; | 807 | nr_sectors >>= ilog2(sdp->sector_size) - 9; |
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index 6174ca4ea275..a7a691d0af7d 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -365,7 +365,6 @@ void sd_dif_prepare(struct request *rq, sector_t hw_sector, | |||
365 | struct bio *bio; | 365 | struct bio *bio; |
366 | struct scsi_disk *sdkp; | 366 | struct scsi_disk *sdkp; |
367 | struct sd_dif_tuple *sdt; | 367 | struct sd_dif_tuple *sdt; |
368 | unsigned int i, j; | ||
369 | u32 phys, virt; | 368 | u32 phys, virt; |
370 | 369 | ||
371 | sdkp = rq->bio->bi_bdev->bd_disk->private_data; | 370 | sdkp = rq->bio->bi_bdev->bd_disk->private_data; |
@@ -376,19 +375,21 @@ void sd_dif_prepare(struct request *rq, sector_t hw_sector, | |||
376 | phys = hw_sector & 0xffffffff; | 375 | phys = hw_sector & 0xffffffff; |
377 | 376 | ||
378 | __rq_for_each_bio(bio, rq) { | 377 | __rq_for_each_bio(bio, rq) { |
379 | struct bio_vec *iv; | 378 | struct bio_vec iv; |
379 | struct bvec_iter iter; | ||
380 | unsigned int j; | ||
380 | 381 | ||
381 | /* Already remapped? */ | 382 | /* Already remapped? */ |
382 | if (bio_flagged(bio, BIO_MAPPED_INTEGRITY)) | 383 | if (bio_flagged(bio, BIO_MAPPED_INTEGRITY)) |
383 | break; | 384 | break; |
384 | 385 | ||
385 | virt = bio->bi_integrity->bip_sector & 0xffffffff; | 386 | virt = bio->bi_integrity->bip_iter.bi_sector & 0xffffffff; |
386 | 387 | ||
387 | bip_for_each_vec(iv, bio->bi_integrity, i) { | 388 | bip_for_each_vec(iv, bio->bi_integrity, iter) { |
388 | sdt = kmap_atomic(iv->bv_page) | 389 | sdt = kmap_atomic(iv.bv_page) |
389 | + iv->bv_offset; | 390 | + iv.bv_offset; |
390 | 391 | ||
391 | for (j = 0 ; j < iv->bv_len ; j += tuple_sz, sdt++) { | 392 | for (j = 0; j < iv.bv_len; j += tuple_sz, sdt++) { |
392 | 393 | ||
393 | if (be32_to_cpu(sdt->ref_tag) == virt) | 394 | if (be32_to_cpu(sdt->ref_tag) == virt) |
394 | sdt->ref_tag = cpu_to_be32(phys); | 395 | sdt->ref_tag = cpu_to_be32(phys); |
@@ -414,7 +415,7 @@ void sd_dif_complete(struct scsi_cmnd *scmd, unsigned int good_bytes) | |||
414 | struct scsi_disk *sdkp; | 415 | struct scsi_disk *sdkp; |
415 | struct bio *bio; | 416 | struct bio *bio; |
416 | struct sd_dif_tuple *sdt; | 417 | struct sd_dif_tuple *sdt; |
417 | unsigned int i, j, sectors, sector_sz; | 418 | unsigned int j, sectors, sector_sz; |
418 | u32 phys, virt; | 419 | u32 phys, virt; |
419 | 420 | ||
420 | sdkp = scsi_disk(scmd->request->rq_disk); | 421 | sdkp = scsi_disk(scmd->request->rq_disk); |
@@ -430,15 +431,16 @@ void sd_dif_complete(struct scsi_cmnd *scmd, unsigned int good_bytes) | |||
430 | phys >>= 3; | 431 | phys >>= 3; |
431 | 432 | ||
432 | __rq_for_each_bio(bio, scmd->request) { | 433 | __rq_for_each_bio(bio, scmd->request) { |
433 | struct bio_vec *iv; | 434 | struct bio_vec iv; |
435 | struct bvec_iter iter; | ||
434 | 436 | ||
435 | virt = bio->bi_integrity->bip_sector & 0xffffffff; | 437 | virt = bio->bi_integrity->bip_iter.bi_sector & 0xffffffff; |
436 | 438 | ||
437 | bip_for_each_vec(iv, bio->bi_integrity, i) { | 439 | bip_for_each_vec(iv, bio->bi_integrity, iter) { |
438 | sdt = kmap_atomic(iv->bv_page) | 440 | sdt = kmap_atomic(iv.bv_page) |
439 | + iv->bv_offset; | 441 | + iv.bv_offset; |
440 | 442 | ||
441 | for (j = 0 ; j < iv->bv_len ; j += tuple_sz, sdt++) { | 443 | for (j = 0; j < iv.bv_len; j += tuple_sz, sdt++) { |
442 | 444 | ||
443 | if (sectors == 0) { | 445 | if (sectors == 0) { |
444 | kunmap_atomic(sdt); | 446 | kunmap_atomic(sdt); |