LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Borislav Petkov <petkovbb@googlemail.com>
To: <bzolnier@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Borislav Petkov <petkovbb@gmail.com>
Subject: [PATCH 08/17] ide-tape: remove pipeline-specific code from idetape_end_request()
Date: Mon, 17 Mar 2008 07:41:21 +0100	[thread overview]
Message-ID: <1205736090-4435-9-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1205736090-4435-1-git-send-email-petkovbb@gmail.com>

As a side effect, remove unused idetape_kfree_stage() and
idetape_abort_pipeline()

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-tape.c |   83 ------------------------------------------------
 1 files changed, 0 insertions(+), 83 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 7e0f4fa..3eeb5c0 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -686,37 +686,6 @@ static void __idetape_kfree_stage(idetape_stage_t *stage)
 	kfree(stage);
 }
 
-static void idetape_kfree_stage(idetape_tape_t *tape, idetape_stage_t *stage)
-{
-	__idetape_kfree_stage(stage);
-}
-
-/*
- * This will free all the pipeline stages starting from new_last_stage->next
- * to the end of the list, and point tape->last_stage to new_last_stage.
- */
-static void idetape_abort_pipeline(ide_drive_t *drive,
-				   idetape_stage_t *new_last_stage)
-{
-	idetape_tape_t *tape = drive->driver_data;
-	idetape_stage_t *stage = new_last_stage->next;
-	idetape_stage_t *nstage;
-
-	debug_log(DBG_PROCS, "%s: Enter %s\n", tape->name, __func__);
-
-	while (stage) {
-		nstage = stage->next;
-		idetape_kfree_stage(tape, stage);
-		--tape->nr_stages;
-		--tape->nr_pending_stages;
-		stage = nstage;
-	}
-	if (new_last_stage)
-		new_last_stage->next = NULL;
-	tape->last_stage = new_last_stage;
-	tape->next_stage = NULL;
-}
-
 /*
  * Finish servicing a request and insert a pending pipeline request into the
  * main device queue.
@@ -725,9 +694,7 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
 {
 	struct request *rq = HWGROUP(drive)->rq;
 	idetape_tape_t *tape = drive->driver_data;
-	unsigned long flags;
 	int error;
-	idetape_stage_t *active_stage;
 
 	debug_log(DBG_PROCS, "Enter %s\n", __func__);
 
@@ -745,58 +712,8 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
 		return 0;
 	}
 
-	spin_lock_irqsave(&tape->lock, flags);
-
-	/* The request was a pipelined data transfer request */
-	if (tape->active_data_rq == rq) {
-		active_stage = tape->active_stage;
-		tape->active_stage = NULL;
-		tape->active_data_rq = NULL;
-		tape->nr_pending_stages--;
-		if (rq->cmd[0] & REQ_IDETAPE_WRITE) {
-			if (error) {
-				set_bit(IDETAPE_FLAG_PIPELINE_ERR,
-					&tape->flags);
-				if (error == IDETAPE_ERROR_EOD)
-					idetape_abort_pipeline(drive,
-								active_stage);
-			}
-		} else if (rq->cmd[0] & REQ_IDETAPE_READ) {
-			if (error == IDETAPE_ERROR_EOD) {
-				set_bit(IDETAPE_FLAG_PIPELINE_ERR,
-					&tape->flags);
-				idetape_abort_pipeline(drive, active_stage);
-			}
-		}
-		if (tape->next_stage != NULL) {
-			idetape_activate_next_stage(drive);
-
-			/* Insert the next request into the request queue. */
-			(void)ide_do_drive_cmd(drive, tape->active_data_rq,
-						ide_end);
-		} else if (!error) {
-			/*
-			 * This is a part of the feedback loop which tries to
-			 * find the optimum number of stages. We are starting
-			 * from a minimum maximum number of stages, and if we
-			 * sense that the pipeline is empty, we try to increase
-			 * it, until we reach the user compile time memory
-			 * limit.
-			 */
-			int i = (tape->max_pipeline - tape->min_pipeline) / 10;
-
-			tape->max_stages += max(i, 1);
-			tape->max_stages = max(tape->max_stages,
-						tape->min_pipeline);
-			tape->max_stages = min(tape->max_stages,
-						tape->max_pipeline);
-		}
-	}
 	ide_end_drive_cmd(drive, 0, 0);
 
-	if (tape->active_data_rq == NULL)
-		clear_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags);
-	spin_unlock_irqrestore(&tape->lock, flags);
 	return 0;
 }
 
-- 
1.5.4.1


  parent reply	other threads:[~2008-03-17  6:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17  6:41 [PATCH 0/17] ide-tape: remove pipeline functionality-v3 Borislav Petkov
2008-03-17  6:41 ` [PATCH 01/17] ide-tape: remove unused parameter from idetape_copy_stage_to_user Borislav Petkov
2008-03-20 21:42   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 02/17] ide-tape: remove unused parameter from idetape_copy_stage_from_user Borislav Petkov
2008-03-20 21:42   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 03/17] ide-tape: remove idetape_discard_read_pipeline() Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 04/17] ide-tape: remove idetape_empty_write_pipeline() Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 05/17] ide-tape: remove pipeline-specific code in idetape_space_over_filemarks() Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 06/17] ide-tape: remove idetape_pipeline_size() Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 07/17] ide-tape: remove idetape_remove_stage_head() Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` Borislav Petkov [this message]
2008-03-21  0:09   ` [PATCH 08/17] ide-tape: remove pipeline-specific code from idetape_end_request() Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 09/17] ide-tape: unwrap idetape_queue_pc_tail() Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 10/17] ide-tape: remove remaining pipeline functionality Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 11/17] ide-tape: remove pipeline-specific code from idetape_setup Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 12/17] ide-tape: remove pipelined mode parameters Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 13/17] ide-tape: remove pipelined mode tape control flags Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 14/17] ide-tape: remove pipeline-specific members from struct ide_tape_obj Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 15/17] ide-tape: remove misc references to pipelined operation in the comments Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 16/17] ide-tape: remove pipelined mode description from Documentation/ide/ide-tape.txt Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-17  6:41 ` [PATCH 17/17] ide-tape: remove comments markup " Borislav Petkov
2008-03-21  0:09   ` Bartlomiej Zolnierkiewicz
2008-03-21  0:04 ` [PATCH 0/17] ide-tape: remove pipeline functionality-v3 Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1205736090-4435-9-git-send-email-petkovbb@gmail.com \
    --to=petkovbb@googlemail.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.com \
    --subject='Re: [PATCH 08/17] ide-tape: remove pipeline-specific code from idetape_end_request()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).