aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 27fd33db0a0b..bdf02fcc1a25 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1090,7 +1090,7 @@ typedef void idetape_io_buf(ide_drive_t *, idetape_pc_t *, unsigned int);
1090 * command. We will transfer some of the data (as requested by the drive) and 1090 * command. We will transfer some of the data (as requested by the drive) and
1091 * will re-point interrupt handler to us. When data transfer is finished, we 1091 * will re-point interrupt handler to us. When data transfer is finished, we
1092 * will act according to the algorithm described before 1092 * will act according to the algorithm described before
1093 * idetape_issue_packet_command. 1093 * idetape_issue_pc.
1094 */ 1094 */
1095static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) 1095static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1096{ 1096{
@@ -1267,7 +1267,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1267 * 1267 *
1268 * The handling will be done in three stages: 1268 * The handling will be done in three stages:
1269 * 1269 *
1270 * 1. idetape_issue_packet_command will send the packet command to the 1270 * 1. idetape_issue_pc will send the packet command to the
1271 * drive, and will set the interrupt handler to idetape_pc_intr. 1271 * drive, and will set the interrupt handler to idetape_pc_intr.
1272 * 1272 *
1273 * 2. On each interrupt, idetape_pc_intr will be called. This step 1273 * 2. On each interrupt, idetape_pc_intr will be called. This step
@@ -1342,7 +1342,7 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
1342 return ide_started; 1342 return ide_started;
1343} 1343}
1344 1344
1345static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape_pc_t *pc) 1345static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, idetape_pc_t *pc)
1346{ 1346{
1347 ide_hwif_t *hwif = drive->hwif; 1347 ide_hwif_t *hwif = drive->hwif;
1348 idetape_tape_t *tape = drive->driver_data; 1348 idetape_tape_t *tape = drive->driver_data;
@@ -1649,7 +1649,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
1649 */ 1649 */
1650 if (tape->failed_pc != NULL && 1650 if (tape->failed_pc != NULL &&
1651 tape->pc->c[0] == REQUEST_SENSE) { 1651 tape->pc->c[0] == REQUEST_SENSE) {
1652 return idetape_issue_packet_command(drive, tape->failed_pc); 1652 return idetape_issue_pc(drive, tape->failed_pc);
1653 } 1653 }
1654 if (postponed_rq != NULL) 1654 if (postponed_rq != NULL)
1655 if (rq != postponed_rq) { 1655 if (rq != postponed_rq) {
@@ -1730,7 +1730,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
1730 } 1730 }
1731 BUG(); 1731 BUG();
1732out: 1732out:
1733 return idetape_issue_packet_command(drive, pc); 1733 return idetape_issue_pc(drive, pc);
1734} 1734}
1735 1735
1736/* 1736/*
@@ -2280,11 +2280,8 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks, struct
2280 return (tape->blk_size * (blocks-rq.current_nr_sectors)); 2280 return (tape->blk_size * (blocks-rq.current_nr_sectors));
2281} 2281}
2282 2282
2283/* 2283/* start servicing the pipeline stages, starting from tape->next_stage. */
2284 * idetape_insert_pipeline_into_queue is used to start servicing the 2284static void idetape_plug_pipeline(ide_drive_t *drive)
2285 * pipeline stages, starting from tape->next_stage.
2286 */
2287static void idetape_insert_pipeline_into_queue (ide_drive_t *drive)
2288{ 2285{
2289 idetape_tape_t *tape = drive->driver_data; 2286 idetape_tape_t *tape = drive->driver_data;
2290 2287
@@ -2376,7 +2373,7 @@ static int idetape_add_chrdev_write_request (ide_drive_t *drive, int blocks)
2376 spin_unlock_irqrestore(&tape->lock, flags); 2373 spin_unlock_irqrestore(&tape->lock, flags);
2377 } else { 2374 } else {
2378 spin_unlock_irqrestore(&tape->lock, flags); 2375 spin_unlock_irqrestore(&tape->lock, flags);
2379 idetape_insert_pipeline_into_queue(drive); 2376 idetape_plug_pipeline(drive);
2380 if (idetape_pipeline_active(tape)) 2377 if (idetape_pipeline_active(tape))
2381 continue; 2378 continue;
2382 /* 2379 /*
@@ -2413,7 +2410,7 @@ static int idetape_add_chrdev_write_request (ide_drive_t *drive, int blocks)
2413 tape->insert_time = jiffies; 2410 tape->insert_time = jiffies;
2414 tape->insert_size = 0; 2411 tape->insert_size = 0;
2415 tape->insert_speed = 0; 2412 tape->insert_speed = 0;
2416 idetape_insert_pipeline_into_queue(drive); 2413 idetape_plug_pipeline(drive);
2417 } 2414 }
2418 } 2415 }
2419 if (test_and_clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags)) 2416 if (test_and_clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags))
@@ -2432,7 +2429,7 @@ static void idetape_wait_for_pipeline (ide_drive_t *drive)
2432 unsigned long flags; 2429 unsigned long flags;
2433 2430
2434 while (tape->next_stage || idetape_pipeline_active(tape)) { 2431 while (tape->next_stage || idetape_pipeline_active(tape)) {
2435 idetape_insert_pipeline_into_queue(drive); 2432 idetape_plug_pipeline(drive);
2436 spin_lock_irqsave(&tape->lock, flags); 2433 spin_lock_irqsave(&tape->lock, flags);
2437 if (idetape_pipeline_active(tape)) 2434 if (idetape_pipeline_active(tape))
2438 idetape_wait_for_request(drive, tape->active_data_rq); 2435 idetape_wait_for_request(drive, tape->active_data_rq);
@@ -2525,7 +2522,7 @@ static void idetape_restart_speed_control (ide_drive_t *drive)
2525 tape->controlled_previous_head_time = tape->uncontrolled_previous_head_time = jiffies; 2522 tape->controlled_previous_head_time = tape->uncontrolled_previous_head_time = jiffies;
2526} 2523}
2527 2524
2528static int idetape_initiate_read (ide_drive_t *drive, int max_stages) 2525static int idetape_init_read(ide_drive_t *drive, int max_stages)
2529{ 2526{
2530 idetape_tape_t *tape = drive->driver_data; 2527 idetape_tape_t *tape = drive->driver_data;
2531 idetape_stage_t *new_stage; 2528 idetape_stage_t *new_stage;
@@ -2586,7 +2583,7 @@ static int idetape_initiate_read (ide_drive_t *drive, int max_stages)
2586 tape->insert_time = jiffies; 2583 tape->insert_time = jiffies;
2587 tape->insert_size = 0; 2584 tape->insert_size = 0;
2588 tape->insert_speed = 0; 2585 tape->insert_speed = 0;
2589 idetape_insert_pipeline_into_queue(drive); 2586 idetape_plug_pipeline(drive);
2590 } 2587 }
2591 } 2588 }
2592 return 0; 2589 return 0;
@@ -2616,7 +2613,7 @@ static int idetape_add_chrdev_read_request (ide_drive_t *drive,int blocks)
2616 * Wait for the next block to be available at the head 2613 * Wait for the next block to be available at the head
2617 * of the pipeline 2614 * of the pipeline
2618 */ 2615 */
2619 idetape_initiate_read(drive, tape->max_stages); 2616 idetape_init_read(drive, tape->max_stages);
2620 if (tape->first_stage == NULL) { 2617 if (tape->first_stage == NULL) {
2621 if (test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags)) 2618 if (test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags))
2622 return 0; 2619 return 0;
@@ -2879,7 +2876,8 @@ static ssize_t idetape_chrdev_read (struct file *file, char __user *buf,
2879 (count % tape->blk_size) == 0) 2876 (count % tape->blk_size) == 0)
2880 tape->user_bs_factor = count / tape->blk_size; 2877 tape->user_bs_factor = count / tape->blk_size;
2881 } 2878 }
2882 if ((rc = idetape_initiate_read(drive, tape->max_stages)) < 0) 2879 rc = idetape_init_read(drive, tape->max_stages);
2880 if (rc < 0)
2883 return rc; 2881 return rc;
2884 if (count == 0) 2882 if (count == 0)
2885 return (0); 2883 return (0);