block: convert to pos and nr_sectors accessors
[linux-block.git] / drivers / s390 / block / dasd_diag.c
index b9a7f77334468ff5afc4e34d59a6baffadb543ea..2efaddfae56088be5d25bf27e4f53991105ec070 100644 (file)
@@ -505,8 +505,9 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev,
                return ERR_PTR(-EINVAL);
        blksize = block->bp_block;
        /* Calculate record id of first and last block. */
-       first_rec = req->sector >> block->s2b_shift;
-       last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift;
+       first_rec = blk_rq_pos(req) >> block->s2b_shift;
+       last_rec =
+               (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
        /* Check struct bio and count the number of blocks for the request. */
        count = 0;
        rq_for_each_segment(bv, req, iter) {