From b7cad3356355f1879799eeaa640f55a31f10e3be Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 1 Apr 2014 21:05:31 +0000 Subject: [PATCH] vdisk_blockio: Fix the (recently enabled) VERIFY command git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5402 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index f3f157827..c00798e75 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -4468,7 +4468,6 @@ static ssize_t blockio_rw_sync(struct scst_vdisk_dev *virt_dev, void *buf, size_t len, loff_t *loff, unsigned rw) { DECLARE_COMPLETION_ONSTACK(c); - int block_shift = virt_dev->dev->block_shift; struct block_device *bdev = virt_dev->bdev; struct bio *bio; void *p; @@ -4492,9 +4491,9 @@ static ssize_t blockio_rw_sync(struct scst_vdisk_dev *virt_dev, void *buf, bio->bi_end_io = blockio_end_sync_io; bio->bi_private = &c; #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) - bio->bi_sector = *loff << (block_shift - 9); + bio->bi_sector = *loff >> 9; #else - bio->bi_iter.bi_sector = *loff << (block_shift - 9); + bio->bi_iter.bi_sector = *loff >> 9; #endif for (p = buf; p < buf + len; p += bytes) { off = offset_in_page(p);