diff options
Diffstat (limited to 'drivers/s390/block')
-rw-r--r-- | drivers/s390/block/dasd.c | 37 | ||||
-rw-r--r-- | drivers/s390/block/dasd_diag.c | 5 | ||||
-rw-r--r-- | drivers/s390/block/dasd_eckd.c | 6 | ||||
-rw-r--r-- | drivers/s390/block/dasd_fba.c | 7 | ||||
-rw-r--r-- | drivers/s390/block/dcssblk.c | 2 | ||||
-rw-r--r-- | drivers/s390/block/xpram.c | 2 |
6 files changed, 23 insertions, 36 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index d1815272c435..27a1be0cd4d4 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -603,7 +603,7 @@ static void dasd_profile_end(struct dasd_block *block, | |||
603 | if (dasd_profile_level != DASD_PROFILE_ON) | 603 | if (dasd_profile_level != DASD_PROFILE_ON) |
604 | return; | 604 | return; |
605 | 605 | ||
606 | sectors = req->nr_sectors; | 606 | sectors = blk_rq_sectors(req); |
607 | if (!cqr->buildclk || !cqr->startclk || | 607 | if (!cqr->buildclk || !cqr->startclk || |
608 | !cqr->stopclk || !cqr->endclk || | 608 | !cqr->stopclk || !cqr->endclk || |
609 | !sectors) | 609 | !sectors) |
@@ -1614,15 +1614,6 @@ void dasd_block_clear_timer(struct dasd_block *block) | |||
1614 | } | 1614 | } |
1615 | 1615 | ||
1616 | /* | 1616 | /* |
1617 | * posts the buffer_cache about a finalized request | ||
1618 | */ | ||
1619 | static inline void dasd_end_request(struct request *req, int error) | ||
1620 | { | ||
1621 | if (__blk_end_request(req, error, blk_rq_bytes(req))) | ||
1622 | BUG(); | ||
1623 | } | ||
1624 | |||
1625 | /* | ||
1626 | * Process finished error recovery ccw. | 1617 | * Process finished error recovery ccw. |
1627 | */ | 1618 | */ |
1628 | static inline void __dasd_block_process_erp(struct dasd_block *block, | 1619 | static inline void __dasd_block_process_erp(struct dasd_block *block, |
@@ -1665,18 +1656,14 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1665 | if (basedev->state < DASD_STATE_READY) | 1656 | if (basedev->state < DASD_STATE_READY) |
1666 | return; | 1657 | return; |
1667 | /* Now we try to fetch requests from the request queue */ | 1658 | /* Now we try to fetch requests from the request queue */ |
1668 | while (!blk_queue_plugged(queue) && | 1659 | while (!blk_queue_plugged(queue) && (req = blk_peek_request(queue))) { |
1669 | elv_next_request(queue)) { | ||
1670 | |||
1671 | req = elv_next_request(queue); | ||
1672 | |||
1673 | if (basedev->features & DASD_FEATURE_READONLY && | 1660 | if (basedev->features & DASD_FEATURE_READONLY && |
1674 | rq_data_dir(req) == WRITE) { | 1661 | rq_data_dir(req) == WRITE) { |
1675 | DBF_DEV_EVENT(DBF_ERR, basedev, | 1662 | DBF_DEV_EVENT(DBF_ERR, basedev, |
1676 | "Rejecting write request %p", | 1663 | "Rejecting write request %p", |
1677 | req); | 1664 | req); |
1678 | blkdev_dequeue_request(req); | 1665 | blk_start_request(req); |
1679 | dasd_end_request(req, -EIO); | 1666 | __blk_end_request_all(req, -EIO); |
1680 | continue; | 1667 | continue; |
1681 | } | 1668 | } |
1682 | cqr = basedev->discipline->build_cp(basedev, block, req); | 1669 | cqr = basedev->discipline->build_cp(basedev, block, req); |
@@ -1704,8 +1691,8 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1704 | "CCW creation failed (rc=%ld) " | 1691 | "CCW creation failed (rc=%ld) " |
1705 | "on request %p", | 1692 | "on request %p", |
1706 | PTR_ERR(cqr), req); | 1693 | PTR_ERR(cqr), req); |
1707 | blkdev_dequeue_request(req); | 1694 | blk_start_request(req); |
1708 | dasd_end_request(req, -EIO); | 1695 | __blk_end_request_all(req, -EIO); |
1709 | continue; | 1696 | continue; |
1710 | } | 1697 | } |
1711 | /* | 1698 | /* |
@@ -1714,7 +1701,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1714 | */ | 1701 | */ |
1715 | cqr->callback_data = (void *) req; | 1702 | cqr->callback_data = (void *) req; |
1716 | cqr->status = DASD_CQR_FILLED; | 1703 | cqr->status = DASD_CQR_FILLED; |
1717 | blkdev_dequeue_request(req); | 1704 | blk_start_request(req); |
1718 | list_add_tail(&cqr->blocklist, &block->ccw_queue); | 1705 | list_add_tail(&cqr->blocklist, &block->ccw_queue); |
1719 | dasd_profile_start(block, cqr, req); | 1706 | dasd_profile_start(block, cqr, req); |
1720 | } | 1707 | } |
@@ -1731,7 +1718,7 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) | |||
1731 | status = cqr->block->base->discipline->free_cp(cqr, req); | 1718 | status = cqr->block->base->discipline->free_cp(cqr, req); |
1732 | if (status <= 0) | 1719 | if (status <= 0) |
1733 | error = status ? status : -EIO; | 1720 | error = status ? status : -EIO; |
1734 | dasd_end_request(req, error); | 1721 | __blk_end_request_all(req, error); |
1735 | } | 1722 | } |
1736 | 1723 | ||
1737 | /* | 1724 | /* |
@@ -2003,7 +1990,7 @@ static void dasd_setup_queue(struct dasd_block *block) | |||
2003 | { | 1990 | { |
2004 | int max; | 1991 | int max; |
2005 | 1992 | ||
2006 | blk_queue_hardsect_size(block->request_queue, block->bp_block); | 1993 | blk_queue_logical_block_size(block->request_queue, block->bp_block); |
2007 | max = block->base->discipline->max_blocks << block->s2b_shift; | 1994 | max = block->base->discipline->max_blocks << block->s2b_shift; |
2008 | blk_queue_max_sectors(block->request_queue, max); | 1995 | blk_queue_max_sectors(block->request_queue, max); |
2009 | blk_queue_max_phys_segments(block->request_queue, -1L); | 1996 | blk_queue_max_phys_segments(block->request_queue, -1L); |
@@ -2038,10 +2025,8 @@ static void dasd_flush_request_queue(struct dasd_block *block) | |||
2038 | return; | 2025 | return; |
2039 | 2026 | ||
2040 | spin_lock_irq(&block->request_queue_lock); | 2027 | spin_lock_irq(&block->request_queue_lock); |
2041 | while ((req = elv_next_request(block->request_queue))) { | 2028 | while ((req = blk_fetch_request(block->request_queue))) |
2042 | blkdev_dequeue_request(req); | 2029 | __blk_end_request_all(req, -EIO); |
2043 | dasd_end_request(req, -EIO); | ||
2044 | } | ||
2045 | spin_unlock_irq(&block->request_queue_lock); | 2030 | spin_unlock_irq(&block->request_queue_lock); |
2046 | } | 2031 | } |
2047 | 2032 | ||
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index b9a7f7733446..2efaddfae560 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c | |||
@@ -505,8 +505,9 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev, | |||
505 | return ERR_PTR(-EINVAL); | 505 | return ERR_PTR(-EINVAL); |
506 | blksize = block->bp_block; | 506 | blksize = block->bp_block; |
507 | /* Calculate record id of first and last block. */ | 507 | /* Calculate record id of first and last block. */ |
508 | first_rec = req->sector >> block->s2b_shift; | 508 | first_rec = blk_rq_pos(req) >> block->s2b_shift; |
509 | last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift; | 509 | last_rec = |
510 | (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift; | ||
510 | /* Check struct bio and count the number of blocks for the request. */ | 511 | /* Check struct bio and count the number of blocks for the request. */ |
511 | count = 0; | 512 | count = 0; |
512 | rq_for_each_segment(bv, req, iter) { | 513 | rq_for_each_segment(bv, req, iter) { |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index cb52da033f06..a41c94053e64 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -2354,10 +2354,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev, | |||
2354 | blksize = block->bp_block; | 2354 | blksize = block->bp_block; |
2355 | blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); | 2355 | blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); |
2356 | /* Calculate record id of first and last block. */ | 2356 | /* Calculate record id of first and last block. */ |
2357 | first_rec = first_trk = req->sector >> block->s2b_shift; | 2357 | first_rec = first_trk = blk_rq_pos(req) >> block->s2b_shift; |
2358 | first_offs = sector_div(first_trk, blk_per_trk); | 2358 | first_offs = sector_div(first_trk, blk_per_trk); |
2359 | last_rec = last_trk = | 2359 | last_rec = last_trk = |
2360 | (req->sector + req->nr_sectors - 1) >> block->s2b_shift; | 2360 | (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift; |
2361 | last_offs = sector_div(last_trk, blk_per_trk); | 2361 | last_offs = sector_div(last_trk, blk_per_trk); |
2362 | cdlspecial = (private->uses_cdl && first_rec < 2*blk_per_trk); | 2362 | cdlspecial = (private->uses_cdl && first_rec < 2*blk_per_trk); |
2363 | 2363 | ||
@@ -2420,7 +2420,7 @@ dasd_eckd_free_cp(struct dasd_ccw_req *cqr, struct request *req) | |||
2420 | private = (struct dasd_eckd_private *) cqr->block->base->private; | 2420 | private = (struct dasd_eckd_private *) cqr->block->base->private; |
2421 | blksize = cqr->block->bp_block; | 2421 | blksize = cqr->block->bp_block; |
2422 | blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); | 2422 | blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); |
2423 | recid = req->sector >> cqr->block->s2b_shift; | 2423 | recid = blk_rq_pos(req) >> cqr->block->s2b_shift; |
2424 | ccw = cqr->cpaddr; | 2424 | ccw = cqr->cpaddr; |
2425 | /* Skip over define extent & locate record. */ | 2425 | /* Skip over define extent & locate record. */ |
2426 | ccw++; | 2426 | ccw++; |
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index a3eb6fd14673..8912358daa2f 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c | |||
@@ -270,8 +270,9 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev, | |||
270 | return ERR_PTR(-EINVAL); | 270 | return ERR_PTR(-EINVAL); |
271 | blksize = block->bp_block; | 271 | blksize = block->bp_block; |
272 | /* Calculate record id of first and last block. */ | 272 | /* Calculate record id of first and last block. */ |
273 | first_rec = req->sector >> block->s2b_shift; | 273 | first_rec = blk_rq_pos(req) >> block->s2b_shift; |
274 | last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift; | 274 | last_rec = |
275 | (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift; | ||
275 | /* Check struct bio and count the number of blocks for the request. */ | 276 | /* Check struct bio and count the number of blocks for the request. */ |
276 | count = 0; | 277 | count = 0; |
277 | cidaw = 0; | 278 | cidaw = 0; |
@@ -309,7 +310,7 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev, | |||
309 | ccw = cqr->cpaddr; | 310 | ccw = cqr->cpaddr; |
310 | /* First ccw is define extent. */ | 311 | /* First ccw is define extent. */ |
311 | define_extent(ccw++, cqr->data, rq_data_dir(req), | 312 | define_extent(ccw++, cqr->data, rq_data_dir(req), |
312 | block->bp_block, req->sector, req->nr_sectors); | 313 | block->bp_block, blk_rq_pos(req), blk_rq_sectors(req)); |
313 | /* Build locate_record + read/write ccws. */ | 314 | /* Build locate_record + read/write ccws. */ |
314 | idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data)); | 315 | idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data)); |
315 | LO_data = (struct LO_fba_data *) (idaws + cidaw); | 316 | LO_data = (struct LO_fba_data *) (idaws + cidaw); |
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index cfdcf1aed33c..a4c7ffcd9987 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -602,7 +602,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char | |||
602 | dev_info->gd->private_data = dev_info; | 602 | dev_info->gd->private_data = dev_info; |
603 | dev_info->gd->driverfs_dev = &dev_info->dev; | 603 | dev_info->gd->driverfs_dev = &dev_info->dev; |
604 | blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request); | 604 | blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request); |
605 | blk_queue_hardsect_size(dev_info->dcssblk_queue, 4096); | 605 | blk_queue_logical_block_size(dev_info->dcssblk_queue, 4096); |
606 | 606 | ||
607 | seg_byte_size = (dev_info->end - dev_info->start + 1); | 607 | seg_byte_size = (dev_info->end - dev_info->start + 1); |
608 | set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors | 608 | set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors |
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index 76814f3e898a..0ae0c83ef879 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c | |||
@@ -343,7 +343,7 @@ static int __init xpram_setup_blkdev(void) | |||
343 | goto out; | 343 | goto out; |
344 | } | 344 | } |
345 | blk_queue_make_request(xpram_queues[i], xpram_make_request); | 345 | blk_queue_make_request(xpram_queues[i], xpram_make_request); |
346 | blk_queue_hardsect_size(xpram_queues[i], 4096); | 346 | blk_queue_logical_block_size(xpram_queues[i], 4096); |
347 | } | 347 | } |
348 | 348 | ||
349 | /* | 349 | /* |