aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-02-05 20:57:52 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-05 20:57:52 -0500
commit97219851b92fd083539003bca48c379d415566ac (patch)
tree57d45e06fc285d7574f81d47704490733a8a9014 /drivers/ide/ide-tape.c
parent54bb2074ce52fc8fce0d898b3c9921f4a951eb80 (diff)
ide-tape: remove idetape_increase_max_pipeline_stages()
This function was being used only at one place so fold it in there. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 2fe4e8fdf3da..27fd33db0a0b 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -810,25 +810,6 @@ static void idetape_activate_next_stage(ide_drive_t *drive)
810} 810}
811 811
812/* 812/*
813 * idetape_increase_max_pipeline_stages is a part of the feedback
814 * loop which tries to find the optimum number of stages. In the
815 * feedback loop, we are starting from a minimum maximum number of
816 * stages, and if we sense that the pipeline is empty, we try to
817 * increase it, until we reach the user compile time memory limit.
818 */
819static void idetape_increase_max_pipeline_stages (ide_drive_t *drive)
820{
821 idetape_tape_t *tape = drive->driver_data;
822 int increase = (tape->max_pipeline - tape->min_pipeline) / 10;
823
824 debug_log(DBG_PROCS, "Enter %s\n", __func__);
825
826 tape->max_stages += max(increase, 1);
827 tape->max_stages = max(tape->max_stages, tape->min_pipeline);
828 tape->max_stages = min(tape->max_stages, tape->max_pipeline);
829}
830
831/*
832 * idetape_kfree_stage calls kfree to completely free a stage, along with 813 * idetape_kfree_stage calls kfree to completely free a stage, along with
833 * its related buffers. 814 * its related buffers.
834 */ 815 */
@@ -976,7 +957,21 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
976 (void)ide_do_drive_cmd(drive, tape->active_data_rq, 957 (void)ide_do_drive_cmd(drive, tape->active_data_rq,
977 ide_end); 958 ide_end);
978 } else if (!error) { 959 } else if (!error) {
979 idetape_increase_max_pipeline_stages(drive); 960 /*
961 * This is a part of the feedback loop which tries to
962 * find the optimum number of stages. We are starting
963 * from a minimum maximum number of stages, and if we
964 * sense that the pipeline is empty, we try to increase
965 * it, until we reach the user compile time memory
966 * limit.
967 */
968 int i = (tape->max_pipeline - tape->min_pipeline) / 10;
969
970 tape->max_stages += max(i, 1);
971 tape->max_stages = max(tape->max_stages,
972 tape->min_pipeline);
973 tape->max_stages = min(tape->max_stages,
974 tape->max_pipeline);
980 } 975 }
981 } 976 }
982 ide_end_drive_cmd(drive, 0, 0); 977 ide_end_drive_cmd(drive, 0, 0);