aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-disk.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-09-03 05:56:16 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:35:36 -0400
commit4913efe456c987057e5d36a3f0a55422a9072cae (patch)
tree295f04a7214e1933df3301dd42c12ff3f282a22c /drivers/ide/ide-disk.c
parent6958f145459ca7ad9715024de97445addacb8510 (diff)
block: deprecate barrier and replace blk_queue_ordered() with blk_queue_flush()
Barrier is deemed too heavy and will soon be replaced by FLUSH/FUA requests. Deprecate barrier. All REQ_HARDBARRIERs are failed with -EOPNOTSUPP and blk_queue_ordered() is replaced with simpler blk_queue_flush(). blk_queue_flush() takes combinations of REQ_FLUSH and FUA. If a device has write cache and can flush it, it should set REQ_FLUSH. If the device can handle FUA writes, it should also set REQ_FUA. All blk_queue_ordered() users are converted. * ORDERED_DRAIN is mapped to 0 which is the default value. * ORDERED_DRAIN_FLUSH is mapped to REQ_FLUSH. * ORDERED_DRAIN_FLUSH_FUA is mapped to REQ_FLUSH | REQ_FUA. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Boaz Harrosh <bharrosh@panasas.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Nick Piggin <npiggin@kernel.dk> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Chris Wright <chrisw@sous-sol.org> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Cc: David S. Miller <davem@davemloft.net> Cc: Alasdair G Kergon <agk@redhat.com> Cc: Pierre Ossman <drzeus@drzeus.cx> Cc: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r--drivers/ide/ide-disk.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 7433e07de30e..7c5b01ce51d2 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -516,10 +516,10 @@ static int ide_do_setfeature(ide_drive_t *drive, u8 feature, u8 nsect)
516 return ide_no_data_taskfile(drive, &cmd); 516 return ide_no_data_taskfile(drive, &cmd);
517} 517}
518 518
519static void update_ordered(ide_drive_t *drive) 519static void update_flush(ide_drive_t *drive)
520{ 520{
521 u16 *id = drive->id; 521 u16 *id = drive->id;
522 unsigned ordered = QUEUE_ORDERED_NONE; 522 unsigned flush = 0;
523 523
524 if (drive->dev_flags & IDE_DFLAG_WCACHE) { 524 if (drive->dev_flags & IDE_DFLAG_WCACHE) {
525 unsigned long long capacity; 525 unsigned long long capacity;
@@ -543,13 +543,12 @@ static void update_ordered(ide_drive_t *drive)
543 drive->name, barrier ? "" : "not "); 543 drive->name, barrier ? "" : "not ");
544 544
545 if (barrier) { 545 if (barrier) {
546 ordered = QUEUE_ORDERED_DRAIN_FLUSH; 546 flush = REQ_FLUSH;
547 blk_queue_prep_rq(drive->queue, idedisk_prep_fn); 547 blk_queue_prep_rq(drive->queue, idedisk_prep_fn);
548 } 548 }
549 } else 549 }
550 ordered = QUEUE_ORDERED_DRAIN;
551 550
552 blk_queue_ordered(drive->queue, ordered); 551 blk_queue_flush(drive->queue, flush);
553} 552}
554 553
555ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE); 554ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE);
@@ -572,7 +571,7 @@ static int set_wcache(ide_drive_t *drive, int arg)
572 } 571 }
573 } 572 }
574 573
575 update_ordered(drive); 574 update_flush(drive);
576 575
577 return err; 576 return err;
578} 577}