diff options
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 76c4c8d13073..4ea2e67ac97c 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -47,8 +47,8 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, | |||
47 | unsigned long block, nsect; | 47 | unsigned long block, nsect; |
48 | char *buf; | 48 | char *buf; |
49 | 49 | ||
50 | block = req->sector << 9 >> tr->blkshift; | 50 | block = blk_rq_pos(req) << 9 >> tr->blkshift; |
51 | nsect = req->current_nr_sectors << 9 >> tr->blkshift; | 51 | nsect = blk_rq_cur_sectors(req) << 9 >> tr->blkshift; |
52 | 52 | ||
53 | buf = req->buffer; | 53 | buf = req->buffer; |
54 | 54 | ||
@@ -59,7 +59,8 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, | |||
59 | if (!blk_fs_request(req)) | 59 | if (!blk_fs_request(req)) |
60 | return -EIO; | 60 | return -EIO; |
61 | 61 | ||
62 | if (req->sector + req->current_nr_sectors > get_capacity(req->rq_disk)) | 62 | if (blk_rq_pos(req) + blk_rq_cur_sectors(req) > |
63 | get_capacity(req->rq_disk)) | ||
63 | return -EIO; | 64 | return -EIO; |
64 | 65 | ||
65 | switch(rq_data_dir(req)) { | 66 | switch(rq_data_dir(req)) { |