ide-disk: update to using blk_queue_write_cache()
authorJens Axboe <axboe@fb.com>
Wed, 30 Mar 2016 16:16:25 +0000 (10:16 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 12 Apr 2016 22:00:39 +0000 (16:00 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
drivers/ide/ide-disk.c

index 37a8a90..05dbcce 100644 (file)
@@ -522,7 +522,7 @@ static int ide_do_setfeature(ide_drive_t *drive, u8 feature, u8 nsect)
 static void update_flush(ide_drive_t *drive)
 {
        u16 *id = drive->id;
 static void update_flush(ide_drive_t *drive)
 {
        u16 *id = drive->id;
-       unsigned flush = 0;
+       bool wc = false;
 
        if (drive->dev_flags & IDE_DFLAG_WCACHE) {
                unsigned long long capacity;
 
        if (drive->dev_flags & IDE_DFLAG_WCACHE) {
                unsigned long long capacity;
@@ -546,12 +546,12 @@ static void update_flush(ide_drive_t *drive)
                       drive->name, barrier ? "" : "not ");
 
                if (barrier) {
                       drive->name, barrier ? "" : "not ");
 
                if (barrier) {
-                       flush = REQ_FLUSH;
+                       wc = true;
                        blk_queue_prep_rq(drive->queue, idedisk_prep_fn);
                }
        }
 
                        blk_queue_prep_rq(drive->queue, idedisk_prep_fn);
                }
        }
 
-       blk_queue_flush(drive->queue, flush);
+       blk_queue_write_cache(drive->queue, wc, false);
 }
 
 ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE);
 }
 
 ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE);