Some dust off the topic branch.
Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
drivers/xen/blktap/device.c | 22 +++++++++-------------
drivers/xen/blktap/ring.c | 2 +-
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/xen/blktap/device.c b/drivers/xen/blktap/device.c
index 4c4d682..c94a0e9 100644
--- a/drivers/xen/blktap/device.c
+++ b/drivers/xen/blktap/device.c
@@ -108,13 +108,13 @@ static struct block_device_operations
blktap_device_file_operations = {
static inline struct request*
__blktap_next_queued_rq(struct request_queue *q)
{
- return elv_next_request(q);
+ return blk_peek_request(q);
}
static inline void
__blktap_dequeue_rq(struct request *rq)
{
- blkdev_dequeue_request(rq);
+ blk_start_request(rq);
}
/* NB. err == 0 indicates success, failures < 0 */
@@ -122,6 +122,7 @@ __blktap_dequeue_rq(struct request *rq)
static inline void
__blktap_end_queued_rq(struct request *rq, int err)
{
+ blk_start_request(rq);
__blk_end_request(rq, err, blk_rq_bytes(rq));
}
@@ -151,7 +152,7 @@ blktap_device_end_request(struct blktap *tap,
blktap_ring_free_request(tap, request);
- dev_dbg(&tapdev->gd->dev,
+ dev_dbg(disk_to_dev(tapdev->gd),
"end_request: op=%d error=%d bytes=%d\n",
rq_data_dir(rq), error, blk_rq_bytes(rq));
@@ -180,7 +181,7 @@ blktap_device_make_request(struct blktap *tap, struct
request *rq)
write = rq_data_dir(rq) == WRITE;
nsegs = blk_rq_map_sg(rq->q, rq, request->sg_table);
- dev_dbg(&tapdev->gd->dev,
+ dev_dbg(disk_to_dev(tapdev->gd),
"make_request: op=%c bytes=%d nsegs=%d\n",
write ? 'w' : 'r', blk_rq_bytes(rq), nsegs);
@@ -210,7 +211,7 @@ _out:
return err;
fail:
if (printk_ratelimit())
- dev_warn(&tapdev->gd->dev,
+ dev_warn(disk_to_dev(tapdev->gd),
"make request: %d, failing\n", err);
goto _out;
}
@@ -244,11 +245,6 @@ blktap_device_run_queue(struct blktap *tap)
continue;
}
- if (blk_empty_barrier(rq)) {
- __blktap_end_queued_rq(rq, 0);
- continue;
- }
-
spin_unlock_irq(&tapdev->lock);
err = blktap_device_make_request(tap, rq);
@@ -491,8 +487,8 @@ blktap_device_create(struct blktap *tap, struct
blktap_params *params)
set_bit(BLKTAP_DEVICE, &tap->dev_inuse);
- dev_info(&gd->dev, "sector-size: %u capacity: %llu\n",
- rq->hardsect_size, get_capacity(gd));
+ dev_info(disk_to_dev(gd), "sector-size: %u capacity: %llu\n",
+ queue_logical_block_size(rq), get_capacity(gd));
return 0;
@@ -520,7 +516,7 @@ blktap_device_debug(struct blktap *tap, char *buf, size_t
size)
s += snprintf(s, end - s,
"disk capacity:%llu sector size:%u\n",
- get_capacity(disk), queue_hardsect_size(q));
+ get_capacity(disk), queue_logical_block_size(q));
s += snprintf(s, end - s,
"queue flags:%#lx plugged:%d stopped:%d empty:%d\n",
diff --git a/drivers/xen/blktap/ring.c b/drivers/xen/blktap/ring.c
index 38896e7..6b86be5 100644
--- a/drivers/xen/blktap/ring.c
+++ b/drivers/xen/blktap/ring.c
@@ -247,7 +247,7 @@ blktap_ring_submit_request(struct blktap *tap,
breq = RING_GET_REQUEST(&ring->ring, ring->ring.req_prod_pvt);
breq->id = request->usr_idx;
- breq->sector_number = request->rq->sector;
+ breq->sector_number = blk_rq_pos(request->rq);
breq->handle = 0;
breq->operation = request->operation;
breq->nr_segments = request->nr_pages;
--
1.7.0.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|