diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2017-06-29 11:31:10 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-07-03 16:56:22 -0600 |
commit | fbd08e7673f950854679e5d79a30bb25e77a9d08 (patch) | |
tree | 7539736c05c4cec5f456b4e41c88d150b7d3353e /block/bio-integrity.c | |
parent | 309a62fa3a9e78cb37a620913151cbb47d83b81d (diff) | |
download | linux-fbd08e7673f950854679e5d79a30bb25e77a9d08.tar.bz2 |
bio-integrity: fix interface for bio_integrity_trim
bio_integrity_trim inherent it's interface from bio_trim and accept
offset and size, but this API is error prone because data offset
must always be insync with bio's data offset. That is why we have
integrity update hook in bio_advance()
So only meaningful values are: offset == 0, sectors == bio_sectors(bio)
Let's just remove them completely.
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio-integrity.c')
-rw-r--r-- | block/bio-integrity.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8c2253c59edb..3a0d71199fb0 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -433,22 +433,15 @@ EXPORT_SYMBOL(bio_integrity_advance); /** * bio_integrity_trim - Trim integrity vector * @bio: bio whose integrity vector to update - * @offset: offset to first data sector - * @sectors: number of data sectors * * Description: Used to trim the integrity vector in a cloned bio. - * The ivec will be advanced corresponding to 'offset' data sectors - * and the length will be truncated corresponding to 'len' data - * sectors. */ -void bio_integrity_trim(struct bio *bio, unsigned int offset, - unsigned int sectors) +void bio_integrity_trim(struct bio *bio) { struct bio_integrity_payload *bip = bio_integrity(bio); struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); - bio_integrity_advance(bio, offset << 9); - bip->bip_iter.bi_size = bio_integrity_bytes(bi, sectors); + bip->bip_iter.bi_size = bio_integrity_bytes(bi, bio_sectors(bio)); } EXPORT_SYMBOL(bio_integrity_trim); |