Skip to content

Commit 98d8c8f

Browse files
fujitaJens Axboe
authored andcommitted
ps3disk: stop using q->prepare_flush_fn
REQ_FLUSH flag enables us to kill ps3disk_prepare_flush(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 7f9815f commit 98d8c8f

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

‎drivers/block/ps3disk.c‎

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,12 @@ static void ps3disk_do_request(struct ps3_storage_device *dev,
196196
dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__);
197197

198198
while ((req = blk_fetch_request(q))) {
199-
if (req->cmd_type == REQ_TYPE_FS) {
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) {
199+
if (req->cmd_flags & REQ_FLUSH) {
204200
if (ps3disk_submit_flush_request(dev, req))
205201
break;
202+
} else if (req->cmd_type == REQ_TYPE_FS) {
203+
if (ps3disk_submit_request_sg(dev, req))
204+
break;
206205
} else {
207206
blk_dump_rq_flags(req, DEVICE_NAME " bad request");
208207
__blk_end_request_all(req, -EIO);
@@ -257,8 +256,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
257256
return IRQ_HANDLED;
258257
}
259258

260-
if (req->cmd_type == REQ_TYPE_LINUX_BLOCK &&
261-
req->cmd[0] == REQ_LB_OP_FLUSH) {
259+
if (req->cmd_flags & REQ_FLUSH) {
262260
read = 0;
263261
op = "flush";
264262
} else {
@@ -398,16 +396,6 @@ static int ps3disk_identify(struct ps3_storage_device *dev)
398396
return 0;
399397
}
400398

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-
411399
static unsigned long ps3disk_mask;
412400

413401
static DEFINE_MUTEX(ps3disk_mask_mutex);
@@ -480,8 +468,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
480468
blk_queue_dma_alignment(queue, dev->blk_size-1);
481469
blk_queue_logical_block_size(queue, dev->blk_size);
482470

483-
blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH,
484-
ps3disk_prepare_flush);
471+
blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH, NULL);
485472

486473
blk_queue_max_segments(queue, -1);
487474
blk_queue_max_segment_size(queue, dev->bounce_size);

0 commit comments

Comments
 (0)