diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-04-27 09:38:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-27 09:38:26 -0400 |
commit | 473567f1a4996a49cb5456e55815051a6e6eb3f1 (patch) | |
tree | 22d35ebb67a955b4df08d63844c72ac9f55d0272 /drivers/ide | |
parent | b361acb1083f0b313a4b398de48450f5edb81fe1 (diff) |
ide-tape: remove idetape_remove_stage_head()
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-tape.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 25ffcbffb02a..cbba475ebc5a 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -692,41 +692,6 @@ static void idetape_kfree_stage(idetape_tape_t *tape, idetape_stage_t *stage) | |||
692 | } | 692 | } |
693 | 693 | ||
694 | /* | 694 | /* |
695 | * Remove tape->first_stage from the pipeline. The caller should avoid race | ||
696 | * conditions. | ||
697 | */ | ||
698 | static void idetape_remove_stage_head(ide_drive_t *drive) | ||
699 | { | ||
700 | idetape_tape_t *tape = drive->driver_data; | ||
701 | idetape_stage_t *stage; | ||
702 | |||
703 | debug_log(DBG_PROCS, "Enter %s\n", __func__); | ||
704 | |||
705 | if (tape->first_stage == NULL) { | ||
706 | printk(KERN_ERR "ide-tape: bug: tape->first_stage is NULL\n"); | ||
707 | return; | ||
708 | } | ||
709 | if (tape->active_stage == tape->first_stage) { | ||
710 | printk(KERN_ERR "ide-tape: bug: Trying to free our active " | ||
711 | "pipeline stage\n"); | ||
712 | return; | ||
713 | } | ||
714 | stage = tape->first_stage; | ||
715 | tape->first_stage = stage->next; | ||
716 | idetape_kfree_stage(tape, stage); | ||
717 | tape->nr_stages--; | ||
718 | if (tape->first_stage == NULL) { | ||
719 | tape->last_stage = NULL; | ||
720 | if (tape->next_stage != NULL) | ||
721 | printk(KERN_ERR "ide-tape: bug: tape->next_stage !=" | ||
722 | " NULL\n"); | ||
723 | if (tape->nr_stages) | ||
724 | printk(KERN_ERR "ide-tape: bug: nr_stages should be 0 " | ||
725 | "now\n"); | ||
726 | } | ||
727 | } | ||
728 | |||
729 | /* | ||
730 | * This will free all the pipeline stages starting from new_last_stage->next | 695 | * This will free all the pipeline stages starting from new_last_stage->next |
731 | * to the end of the list, and point tape->last_stage to new_last_stage. | 696 | * to the end of the list, and point tape->last_stage to new_last_stage. |
732 | */ | 697 | */ |
@@ -762,7 +727,6 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects) | |||
762 | idetape_tape_t *tape = drive->driver_data; | 727 | idetape_tape_t *tape = drive->driver_data; |
763 | unsigned long flags; | 728 | unsigned long flags; |
764 | int error; | 729 | int error; |
765 | int remove_stage = 0; | ||
766 | idetape_stage_t *active_stage; | 730 | idetape_stage_t *active_stage; |
767 | 731 | ||
768 | debug_log(DBG_PROCS, "Enter %s\n", __func__); | 732 | debug_log(DBG_PROCS, "Enter %s\n", __func__); |
@@ -790,7 +754,6 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects) | |||
790 | tape->active_data_rq = NULL; | 754 | tape->active_data_rq = NULL; |
791 | tape->nr_pending_stages--; | 755 | tape->nr_pending_stages--; |
792 | if (rq->cmd[0] & REQ_IDETAPE_WRITE) { | 756 | if (rq->cmd[0] & REQ_IDETAPE_WRITE) { |
793 | remove_stage = 1; | ||
794 | if (error) { | 757 | if (error) { |
795 | set_bit(IDETAPE_FLAG_PIPELINE_ERR, | 758 | set_bit(IDETAPE_FLAG_PIPELINE_ERR, |
796 | &tape->flags); | 759 | &tape->flags); |
@@ -831,8 +794,6 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects) | |||
831 | } | 794 | } |
832 | ide_end_drive_cmd(drive, 0, 0); | 795 | ide_end_drive_cmd(drive, 0, 0); |
833 | 796 | ||
834 | if (remove_stage) | ||
835 | idetape_remove_stage_head(drive); | ||
836 | if (tape->active_data_rq == NULL) | 797 | if (tape->active_data_rq == NULL) |
837 | clear_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags); | 798 | clear_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags); |
838 | spin_unlock_irqrestore(&tape->lock, flags); | 799 | spin_unlock_irqrestore(&tape->lock, flags); |
@@ -1914,7 +1875,6 @@ static int __idetape_discard_read_pipeline(ide_drive_t *drive) | |||
1914 | cnt += rq_ptr->nr_sectors - rq_ptr->current_nr_sectors; | 1875 | cnt += rq_ptr->nr_sectors - rq_ptr->current_nr_sectors; |
1915 | if (rq_ptr->errors == IDETAPE_ERROR_FILEMARK) | 1876 | if (rq_ptr->errors == IDETAPE_ERROR_FILEMARK) |
1916 | ++cnt; | 1877 | ++cnt; |
1917 | idetape_remove_stage_head(drive); | ||
1918 | } | 1878 | } |
1919 | tape->nr_pending_stages = 0; | 1879 | tape->nr_pending_stages = 0; |
1920 | tape->max_stages = tape->min_pipeline; | 1880 | tape->max_stages = tape->min_pipeline; |