diff options
Diffstat (limited to 'drivers/block/ps3disk.c')
-rw-r--r-- | drivers/block/ps3disk.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 3b419e3fffa1..e9da874d0419 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c | |||
@@ -196,13 +196,12 @@ static void ps3disk_do_request(struct ps3_storage_device *dev, | |||
196 | dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); | 196 | dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); |
197 | 197 | ||
198 | while ((req = blk_fetch_request(q))) { | 198 | while ((req = blk_fetch_request(q))) { |
199 | if (blk_fs_request(req)) { | 199 | if (req->cmd_flags & REQ_FLUSH) { |
200 | if (ps3disk_submit_request_sg(dev, req)) | ||
201 | break; | ||
202 | } else if (req->cmd_type == REQ_TYPE_LINUX_BLOCK && | ||
203 | req->cmd[0] == REQ_LB_OP_FLUSH) { | ||
204 | if (ps3disk_submit_flush_request(dev, req)) | 200 | if (ps3disk_submit_flush_request(dev, req)) |
205 | break; | 201 | break; |
202 | } else if (req->cmd_type == REQ_TYPE_FS) { | ||
203 | if (ps3disk_submit_request_sg(dev, req)) | ||
204 | break; | ||
206 | } else { | 205 | } else { |
207 | blk_dump_rq_flags(req, DEVICE_NAME " bad request"); | 206 | blk_dump_rq_flags(req, DEVICE_NAME " bad request"); |
208 | __blk_end_request_all(req, -EIO); | 207 | __blk_end_request_all(req, -EIO); |
@@ -257,8 +256,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data) | |||
257 | return IRQ_HANDLED; | 256 | return IRQ_HANDLED; |
258 | } | 257 | } |
259 | 258 | ||
260 | if (req->cmd_type == REQ_TYPE_LINUX_BLOCK && | 259 | if (req->cmd_flags & REQ_FLUSH) { |
261 | req->cmd[0] == REQ_LB_OP_FLUSH) { | ||
262 | read = 0; | 260 | read = 0; |
263 | op = "flush"; | 261 | op = "flush"; |
264 | } else { | 262 | } else { |
@@ -398,16 +396,6 @@ static int ps3disk_identify(struct ps3_storage_device *dev) | |||
398 | return 0; | 396 | return 0; |
399 | } | 397 | } |
400 | 398 | ||
401 | static void ps3disk_prepare_flush(struct request_queue *q, struct request *req) | ||
402 | { | ||
403 | struct ps3_storage_device *dev = q->queuedata; | ||
404 | |||
405 | dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); | ||
406 | |||
407 | req->cmd_type = REQ_TYPE_LINUX_BLOCK; | ||
408 | req->cmd[0] = REQ_LB_OP_FLUSH; | ||
409 | } | ||
410 | |||
411 | static unsigned long ps3disk_mask; | 399 | static unsigned long ps3disk_mask; |
412 | 400 | ||
413 | static DEFINE_MUTEX(ps3disk_mask_mutex); | 401 | static DEFINE_MUTEX(ps3disk_mask_mutex); |
@@ -480,8 +468,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) | |||
480 | blk_queue_dma_alignment(queue, dev->blk_size-1); | 468 | blk_queue_dma_alignment(queue, dev->blk_size-1); |
481 | blk_queue_logical_block_size(queue, dev->blk_size); | 469 | blk_queue_logical_block_size(queue, dev->blk_size); |
482 | 470 | ||
483 | blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH, | 471 | blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH); |
484 | ps3disk_prepare_flush); | ||
485 | 472 | ||
486 | blk_queue_max_segments(queue, -1); | 473 | blk_queue_max_segments(queue, -1); |
487 | blk_queue_max_segment_size(queue, dev->bounce_size); | 474 | blk_queue_max_segment_size(queue, dev->bounce_size); |