diff options
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r-- | drivers/block/ub.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 8c2cc71327e3..dc3b899ad2b3 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -726,8 +726,8 @@ static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, | |||
726 | * The call to blk_queue_hardsect_size() guarantees that request | 726 | * The call to blk_queue_hardsect_size() guarantees that request |
727 | * is aligned, but it is given in terms of 512 byte units, always. | 727 | * is aligned, but it is given in terms of 512 byte units, always. |
728 | */ | 728 | */ |
729 | block = rq->sector >> lun->capacity.bshift; | 729 | block = blk_rq_pos(rq) >> lun->capacity.bshift; |
730 | nblks = rq->nr_sectors >> lun->capacity.bshift; | 730 | nblks = blk_rq_sectors(rq) >> lun->capacity.bshift; |
731 | 731 | ||
732 | cmd->cdb[0] = (cmd->dir == UB_DIR_READ)? READ_10: WRITE_10; | 732 | cmd->cdb[0] = (cmd->dir == UB_DIR_READ)? READ_10: WRITE_10; |
733 | /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */ | 733 | /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */ |
@@ -739,7 +739,7 @@ static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, | |||
739 | cmd->cdb[8] = nblks; | 739 | cmd->cdb[8] = nblks; |
740 | cmd->cdb_len = 10; | 740 | cmd->cdb_len = 10; |
741 | 741 | ||
742 | cmd->len = rq->nr_sectors * 512; | 742 | cmd->len = blk_rq_sectors(rq) * 512; |
743 | } | 743 | } |
744 | 744 | ||
745 | static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, | 745 | static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, |