fs: Starting sector size calculation
PATCH 2/4 fs: Starting sector size calculation
From: Keith Busch <[email protected]>
Use the block device sector size to calculate the starting sector when generating and verifying the data integrity.
Signed-off-by Keith Busch <keith.busch at intel.com>
--- fs/bio-integrity.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/bio-integrity.c +2 -2
@@ -335,7 +335,7 @@ static void bio_integrity_generate(struct bio *bio)struct blk_integrity *bi =bdev_get_integrity (bio->bi_bdev);struct blk_integrity_exchg bix;struct bio_vec *bv; -sector_t sector = bio->bi_sector; +sector_t sector = (bio->bi_sector <<9 ) / bi->sector_size;unsigned int i, sectors, total;void *prot_buf = bio->bi_integrity->bip_buf;
@@ -476,7 +476,7 @@ static int bio_integrity_verify(struct bio *bio)struct blk_integrity *bi =bdev_get_integrity (bio->bi_bdev);struct blk_integrity_exchg bix;struct bio_vec *bv; -sector_t sector = bio->bi_integrity->bip_sector; +sector_t sector = (bio->bi_sector <<9 ) / bi->sector_size;unsigned int i, sectors, total, ret;void *prot_buf = bio->bi_integrity->bip_buf;
Signature · 1 line
1.7.0.4