diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-11-01 14:32:27 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-11-02 10:43:51 -0400 |
commit | c64e38ea17a81721da0393584fd807f8434050fa (patch) | |
tree | b4c7203aa006fd618cb3477fcddf8c74b509da3f /drivers/block | |
parent | c8ddb2713c624f432fa5fe3c7ecffcdda46ea0d4 (diff) |
xen/blkfront: map REQ_FLUSH into a full barrier
Implement a flush as a full barrier, since we have nothing weaker.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/xen-blkfront.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 06e2812ba124..3a318d8576c5 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -245,14 +245,11 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode, | |||
245 | } | 245 | } |
246 | 246 | ||
247 | /* | 247 | /* |
248 | * blkif_queue_request | 248 | * Generate a Xen blkfront IO request from a blk layer request. Reads |
249 | * and writes are handled as expected. Since we lack a loose flush | ||
250 | * request, we map flushes into a full ordered barrier. | ||
249 | * | 251 | * |
250 | * request block io | 252 | * @req: a request struct |
251 | * | ||
252 | * id: for guest use only. | ||
253 | * operation: BLKIF_OP_{READ,WRITE,PROBE} | ||
254 | * buffer: buffer to read/write into. this should be a | ||
255 | * virtual address in the guest os. | ||
256 | */ | 253 | */ |
257 | static int blkif_queue_request(struct request *req) | 254 | static int blkif_queue_request(struct request *req) |
258 | { | 255 | { |
@@ -289,7 +286,7 @@ static int blkif_queue_request(struct request *req) | |||
289 | 286 | ||
290 | ring_req->operation = rq_data_dir(req) ? | 287 | ring_req->operation = rq_data_dir(req) ? |
291 | BLKIF_OP_WRITE : BLKIF_OP_READ; | 288 | BLKIF_OP_WRITE : BLKIF_OP_READ; |
292 | if (req->cmd_flags & REQ_HARDBARRIER) | 289 | if (req->cmd_flags & REQ_FLUSH) |
293 | ring_req->operation = BLKIF_OP_WRITE_BARRIER; | 290 | ring_req->operation = BLKIF_OP_WRITE_BARRIER; |
294 | 291 | ||
295 | ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); | 292 | ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); |
@@ -1069,14 +1066,8 @@ static void blkfront_connect(struct blkfront_info *info) | |||
1069 | */ | 1066 | */ |
1070 | info->feature_flush = 0; | 1067 | info->feature_flush = 0; |
1071 | 1068 | ||
1072 | /* | ||
1073 | * The driver doesn't properly handled empty flushes, so | ||
1074 | * lets disable barrier support for now. | ||
1075 | */ | ||
1076 | #if 0 | ||
1077 | if (!err && barrier) | 1069 | if (!err && barrier) |
1078 | info->feature_flush = REQ_FLUSH; | 1070 | info->feature_flush = REQ_FLUSH; |
1079 | #endif | ||
1080 | 1071 | ||
1081 | err = xlvbd_alloc_gendisk(sectors, info, binfo, sector_size); | 1072 | err = xlvbd_alloc_gendisk(sectors, info, binfo, sector_size); |
1082 | if (err) { | 1073 | if (err) { |