diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 06:29:29 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 06:29:29 -0400 |
commit | a39d113936370ba524fa9e34d6954c3625c8aa64 (patch) | |
tree | 6e4334d4fe9018a6032a2cf47f144e1716ca30ad /drivers/ide | |
parent | 8b6800fbced0c6745a9b8f5f72f15ef8bce8a6be (diff) | |
parent | 7e3da6c4b9a69f44b758b2c88190ac33ac4ea1a1 (diff) |
Merge branch 'barrier' into for-linus
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-disk.c | 29 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 35 |
2 files changed, 0 insertions, 64 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 4754769eda97..92177ca48b4d 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -716,32 +716,6 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) | |||
716 | rq->buffer = rq->cmd; | 716 | rq->buffer = rq->cmd; |
717 | } | 717 | } |
718 | 718 | ||
719 | static int idedisk_issue_flush(struct request_queue *q, struct gendisk *disk, | ||
720 | sector_t *error_sector) | ||
721 | { | ||
722 | ide_drive_t *drive = q->queuedata; | ||
723 | struct request *rq; | ||
724 | int ret; | ||
725 | |||
726 | if (!drive->wcache) | ||
727 | return 0; | ||
728 | |||
729 | rq = blk_get_request(q, WRITE, __GFP_WAIT); | ||
730 | |||
731 | idedisk_prepare_flush(q, rq); | ||
732 | |||
733 | ret = blk_execute_rq(q, disk, rq, 0); | ||
734 | |||
735 | /* | ||
736 | * if we failed and caller wants error offset, get it | ||
737 | */ | ||
738 | if (ret && error_sector) | ||
739 | *error_sector = ide_get_error_location(drive, rq->cmd); | ||
740 | |||
741 | blk_put_request(rq); | ||
742 | return ret; | ||
743 | } | ||
744 | |||
745 | /* | 719 | /* |
746 | * This is tightly woven into the driver->do_special can not touch. | 720 | * This is tightly woven into the driver->do_special can not touch. |
747 | * DON'T do it again until a total personality rewrite is committed. | 721 | * DON'T do it again until a total personality rewrite is committed. |
@@ -781,7 +755,6 @@ static void update_ordered(ide_drive_t *drive) | |||
781 | struct hd_driveid *id = drive->id; | 755 | struct hd_driveid *id = drive->id; |
782 | unsigned ordered = QUEUE_ORDERED_NONE; | 756 | unsigned ordered = QUEUE_ORDERED_NONE; |
783 | prepare_flush_fn *prep_fn = NULL; | 757 | prepare_flush_fn *prep_fn = NULL; |
784 | issue_flush_fn *issue_fn = NULL; | ||
785 | 758 | ||
786 | if (drive->wcache) { | 759 | if (drive->wcache) { |
787 | unsigned long long capacity; | 760 | unsigned long long capacity; |
@@ -805,13 +778,11 @@ static void update_ordered(ide_drive_t *drive) | |||
805 | if (barrier) { | 778 | if (barrier) { |
806 | ordered = QUEUE_ORDERED_DRAIN_FLUSH; | 779 | ordered = QUEUE_ORDERED_DRAIN_FLUSH; |
807 | prep_fn = idedisk_prepare_flush; | 780 | prep_fn = idedisk_prepare_flush; |
808 | issue_fn = idedisk_issue_flush; | ||
809 | } | 781 | } |
810 | } else | 782 | } else |
811 | ordered = QUEUE_ORDERED_DRAIN; | 783 | ordered = QUEUE_ORDERED_DRAIN; |
812 | 784 | ||
813 | blk_queue_ordered(drive->queue, ordered, prep_fn); | 785 | blk_queue_ordered(drive->queue, ordered, prep_fn); |
814 | blk_queue_issue_flush_fn(drive->queue, issue_fn); | ||
815 | } | 786 | } |
816 | 787 | ||
817 | static int write_cache(ide_drive_t *drive, int arg) | 788 | static int write_cache(ide_drive_t *drive, int arg) |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 4cece930114c..f36ff5962af6 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -322,41 +322,6 @@ static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq) | |||
322 | spin_unlock_irqrestore(&ide_lock, flags); | 322 | spin_unlock_irqrestore(&ide_lock, flags); |
323 | } | 323 | } |
324 | 324 | ||
325 | /* | ||
326 | * FIXME: probably move this somewhere else, name is bad too :) | ||
327 | */ | ||
328 | u64 ide_get_error_location(ide_drive_t *drive, char *args) | ||
329 | { | ||
330 | u32 high, low; | ||
331 | u8 hcyl, lcyl, sect; | ||
332 | u64 sector; | ||
333 | |||
334 | high = 0; | ||
335 | hcyl = args[5]; | ||
336 | lcyl = args[4]; | ||
337 | sect = args[3]; | ||
338 | |||
339 | if (ide_id_has_flush_cache_ext(drive->id)) { | ||
340 | low = (hcyl << 16) | (lcyl << 8) | sect; | ||
341 | HWIF(drive)->OUTB(drive->ctl|0x80, IDE_CONTROL_REG); | ||
342 | high = ide_read_24(drive); | ||
343 | } else { | ||
344 | u8 cur = HWIF(drive)->INB(IDE_SELECT_REG); | ||
345 | if (cur & 0x40) { | ||
346 | high = cur & 0xf; | ||
347 | low = (hcyl << 16) | (lcyl << 8) | sect; | ||
348 | } else { | ||
349 | low = hcyl * drive->head * drive->sect; | ||
350 | low += lcyl * drive->sect; | ||
351 | low += sect - 1; | ||
352 | } | ||
353 | } | ||
354 | |||
355 | sector = ((u64) high << 24) | low; | ||
356 | return sector; | ||
357 | } | ||
358 | EXPORT_SYMBOL(ide_get_error_location); | ||
359 | |||
360 | /** | 325 | /** |
361 | * ide_end_drive_cmd - end an explicit drive command | 326 | * ide_end_drive_cmd - end an explicit drive command |
362 | * @drive: command | 327 | * @drive: command |