diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2014-09-26 19:19:56 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-27 11:14:46 -0400 |
commit | 180b2f95dd331010a9930a65c8a18d6d81b94dc1 (patch) | |
tree | 8ceb4a28e15e1e588b52022a844f81daabd0f92d /drivers/scsi/sd_dif.c | |
parent | e7258c1a269e0967856c81d182c286a78f5ecf15 (diff) |
block: Replace bi_integrity with bi_special
For commands like REQ_COPY we need a way to pass extra information along
with each bio. Like integrity metadata this information must be
available at the bottom of the stack so bi_private does not suffice.
Rename the existing bi_integrity field to bi_special and make it a union
so we can have different bio extensions for each class of command.
We previously used bi_integrity != NULL as a way to identify whether a
bio had integrity metadata or not. Introduce a REQ_INTEGRITY to be the
indicator now that bi_special can contain different things.
In addition, bio_integrity(bio) will now return a pointer to the
integrity payload (when applicable).
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/scsi/sd_dif.c')
-rw-r--r-- | drivers/scsi/sd_dif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index a7a691d0af7d..29f0477a8708 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -383,9 +383,9 @@ void sd_dif_prepare(struct request *rq, sector_t hw_sector, | |||
383 | if (bio_flagged(bio, BIO_MAPPED_INTEGRITY)) | 383 | if (bio_flagged(bio, BIO_MAPPED_INTEGRITY)) |
384 | break; | 384 | break; |
385 | 385 | ||
386 | virt = bio->bi_integrity->bip_iter.bi_sector & 0xffffffff; | 386 | virt = bio_integrity(bio)->bip_iter.bi_sector & 0xffffffff; |
387 | 387 | ||
388 | bip_for_each_vec(iv, bio->bi_integrity, iter) { | 388 | bip_for_each_vec(iv, bio_integrity(bio), iter) { |
389 | sdt = kmap_atomic(iv.bv_page) | 389 | sdt = kmap_atomic(iv.bv_page) |
390 | + iv.bv_offset; | 390 | + iv.bv_offset; |
391 | 391 | ||
@@ -434,9 +434,9 @@ void sd_dif_complete(struct scsi_cmnd *scmd, unsigned int good_bytes) | |||
434 | struct bio_vec iv; | 434 | struct bio_vec iv; |
435 | struct bvec_iter iter; | 435 | struct bvec_iter iter; |
436 | 436 | ||
437 | virt = bio->bi_integrity->bip_iter.bi_sector & 0xffffffff; | 437 | virt = bio_integrity(bio)->bip_iter.bi_sector & 0xffffffff; |
438 | 438 | ||
439 | bip_for_each_vec(iv, bio->bi_integrity, iter) { | 439 | bip_for_each_vec(iv, bio_integrity(bio), iter) { |
440 | sdt = kmap_atomic(iv.bv_page) | 440 | sdt = kmap_atomic(iv.bv_page) |
441 | + iv.bv_offset; | 441 | + iv.bv_offset; |
442 | 442 | ||