aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-04-27 09:38:34 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:34 -0400
commitec0fdb01f808e3f0b50378bfabaee4ced41a8fd9 (patch)
treea0d8336d0a00ca0284e262a41096b0fcb63ae412
parent9798630a75c2c13849aeefcc1ba0559a701b5d95 (diff)
ide-tape: mv idetape_discard_read_pipeline ide_tape_discard_merge_buffer
Also, rename its __-low level helper too. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-tape.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3c61770020ef..1358d8351f33 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1641,7 +1641,7 @@ static int idetape_create_prevent_cmd(ide_drive_t *drive,
1641 return 1; 1641 return 1;
1642} 1642}
1643 1643
1644static void __idetape_discard_read_pipeline(ide_drive_t *drive) 1644static void __ide_tape_discard_merge_buffer(ide_drive_t *drive)
1645{ 1645{
1646 idetape_tape_t *tape = drive->driver_data; 1646 idetape_tape_t *tape = drive->driver_data;
1647 1647
@@ -1672,7 +1672,7 @@ static int idetape_position_tape(ide_drive_t *drive, unsigned int block,
1672 struct ide_atapi_pc pc; 1672 struct ide_atapi_pc pc;
1673 1673
1674 if (tape->chrdev_dir == IDETAPE_DIR_READ) 1674 if (tape->chrdev_dir == IDETAPE_DIR_READ)
1675 __idetape_discard_read_pipeline(drive); 1675 __ide_tape_discard_merge_buffer(drive);
1676 idetape_wait_ready(drive, 60 * 5 * HZ); 1676 idetape_wait_ready(drive, 60 * 5 * HZ);
1677 idetape_create_locate_cmd(drive, &pc, block, partition, skip); 1677 idetape_create_locate_cmd(drive, &pc, block, partition, skip);
1678 retval = idetape_queue_pc_tail(drive, &pc); 1678 retval = idetape_queue_pc_tail(drive, &pc);
@@ -1683,19 +1683,19 @@ static int idetape_position_tape(ide_drive_t *drive, unsigned int block,
1683 return (idetape_queue_pc_tail(drive, &pc)); 1683 return (idetape_queue_pc_tail(drive, &pc));
1684} 1684}
1685 1685
1686static void idetape_discard_read_pipeline(ide_drive_t *drive, 1686static void ide_tape_discard_merge_buffer(ide_drive_t *drive,
1687 int restore_position) 1687 int restore_position)
1688{ 1688{
1689 idetape_tape_t *tape = drive->driver_data; 1689 idetape_tape_t *tape = drive->driver_data;
1690 int seek, position; 1690 int seek, position;
1691 1691
1692 __idetape_discard_read_pipeline(drive); 1692 __ide_tape_discard_merge_buffer(drive);
1693 if (restore_position) { 1693 if (restore_position) {
1694 position = idetape_read_position(drive); 1694 position = idetape_read_position(drive);
1695 seek = position > 0 ? position : 0; 1695 seek = position > 0 ? position : 0;
1696 if (idetape_position_tape(drive, seek, 0, 0)) { 1696 if (idetape_position_tape(drive, seek, 0, 0)) {
1697 printk(KERN_INFO "ide-tape: %s: position_tape failed in" 1697 printk(KERN_INFO "ide-tape: %s: position_tape failed in"
1698 " discard_pipeline()\n", tape->name); 1698 " %s\n", tape->name, __func__);
1699 return; 1699 return;
1700 } 1700 }
1701 } 1701 }
@@ -1996,7 +1996,7 @@ static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op,
1996 tape->merge_stage_size = 0; 1996 tape->merge_stage_size = 0;
1997 if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags)) 1997 if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags))
1998 ++count; 1998 ++count;
1999 idetape_discard_read_pipeline(drive, 0); 1999 ide_tape_discard_merge_buffer(drive, 0);
2000 } 2000 }
2001 2001
2002 /* 2002 /*
@@ -2121,7 +2121,7 @@ static ssize_t idetape_chrdev_write(struct file *file, const char __user *buf,
2121 /* Initialize write operation */ 2121 /* Initialize write operation */
2122 if (tape->chrdev_dir != IDETAPE_DIR_WRITE) { 2122 if (tape->chrdev_dir != IDETAPE_DIR_WRITE) {
2123 if (tape->chrdev_dir == IDETAPE_DIR_READ) 2123 if (tape->chrdev_dir == IDETAPE_DIR_READ)
2124 idetape_discard_read_pipeline(drive, 1); 2124 ide_tape_discard_merge_buffer(drive, 1);
2125 if (tape->merge_stage || tape->merge_stage_size) { 2125 if (tape->merge_stage || tape->merge_stage_size) {
2126 printk(KERN_ERR "ide-tape: merge_stage_size " 2126 printk(KERN_ERR "ide-tape: merge_stage_size "
2127 "should be 0 now\n"); 2127 "should be 0 now\n");
@@ -2246,7 +2246,7 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
2246 case MTWEOF: 2246 case MTWEOF:
2247 if (tape->write_prot) 2247 if (tape->write_prot)
2248 return -EACCES; 2248 return -EACCES;
2249 idetape_discard_read_pipeline(drive, 1); 2249 ide_tape_discard_merge_buffer(drive, 1);
2250 for (i = 0; i < mt_count; i++) { 2250 for (i = 0; i < mt_count; i++) {
2251 retval = idetape_write_filemark(drive); 2251 retval = idetape_write_filemark(drive);
2252 if (retval) 2252 if (retval)
@@ -2254,12 +2254,12 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
2254 } 2254 }
2255 return 0; 2255 return 0;
2256 case MTREW: 2256 case MTREW:
2257 idetape_discard_read_pipeline(drive, 0); 2257 ide_tape_discard_merge_buffer(drive, 0);
2258 if (idetape_rewind_tape(drive)) 2258 if (idetape_rewind_tape(drive))
2259 return -EIO; 2259 return -EIO;
2260 return 0; 2260 return 0;
2261 case MTLOAD: 2261 case MTLOAD:
2262 idetape_discard_read_pipeline(drive, 0); 2262 ide_tape_discard_merge_buffer(drive, 0);
2263 idetape_create_load_unload_cmd(drive, &pc, 2263 idetape_create_load_unload_cmd(drive, &pc,
2264 IDETAPE_LU_LOAD_MASK); 2264 IDETAPE_LU_LOAD_MASK);
2265 return idetape_queue_pc_tail(drive, &pc); 2265 return idetape_queue_pc_tail(drive, &pc);
@@ -2274,7 +2274,7 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
2274 if (!idetape_queue_pc_tail(drive, &pc)) 2274 if (!idetape_queue_pc_tail(drive, &pc))
2275 tape->door_locked = DOOR_UNLOCKED; 2275 tape->door_locked = DOOR_UNLOCKED;
2276 } 2276 }
2277 idetape_discard_read_pipeline(drive, 0); 2277 ide_tape_discard_merge_buffer(drive, 0);
2278 idetape_create_load_unload_cmd(drive, &pc, 2278 idetape_create_load_unload_cmd(drive, &pc,
2279 !IDETAPE_LU_LOAD_MASK); 2279 !IDETAPE_LU_LOAD_MASK);
2280 retval = idetape_queue_pc_tail(drive, &pc); 2280 retval = idetape_queue_pc_tail(drive, &pc);
@@ -2282,10 +2282,10 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
2282 clear_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags); 2282 clear_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags);
2283 return retval; 2283 return retval;
2284 case MTNOP: 2284 case MTNOP:
2285 idetape_discard_read_pipeline(drive, 0); 2285 ide_tape_discard_merge_buffer(drive, 0);
2286 return idetape_flush_tape_buffers(drive); 2286 return idetape_flush_tape_buffers(drive);
2287 case MTRETEN: 2287 case MTRETEN:
2288 idetape_discard_read_pipeline(drive, 0); 2288 ide_tape_discard_merge_buffer(drive, 0);
2289 idetape_create_load_unload_cmd(drive, &pc, 2289 idetape_create_load_unload_cmd(drive, &pc,
2290 IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK); 2290 IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK);
2291 return idetape_queue_pc_tail(drive, &pc); 2291 return idetape_queue_pc_tail(drive, &pc);
@@ -2307,11 +2307,11 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
2307 set_bit(IDETAPE_FLAG_DETECT_BS, &tape->flags); 2307 set_bit(IDETAPE_FLAG_DETECT_BS, &tape->flags);
2308 return 0; 2308 return 0;
2309 case MTSEEK: 2309 case MTSEEK:
2310 idetape_discard_read_pipeline(drive, 0); 2310 ide_tape_discard_merge_buffer(drive, 0);
2311 return idetape_position_tape(drive, 2311 return idetape_position_tape(drive,
2312 mt_count * tape->user_bs_factor, tape->partition, 0); 2312 mt_count * tape->user_bs_factor, tape->partition, 0);
2313 case MTSETPART: 2313 case MTSETPART:
2314 idetape_discard_read_pipeline(drive, 0); 2314 ide_tape_discard_merge_buffer(drive, 0);
2315 return idetape_position_tape(drive, 0, mt_count, 0); 2315 return idetape_position_tape(drive, 0, mt_count, 0);
2316 case MTFSR: 2316 case MTFSR:
2317 case MTBSR: 2317 case MTBSR:
@@ -2393,7 +2393,7 @@ static int idetape_chrdev_ioctl(struct inode *inode, struct file *file,
2393 return 0; 2393 return 0;
2394 default: 2394 default:
2395 if (tape->chrdev_dir == IDETAPE_DIR_READ) 2395 if (tape->chrdev_dir == IDETAPE_DIR_READ)
2396 idetape_discard_read_pipeline(drive, 1); 2396 ide_tape_discard_merge_buffer(drive, 1);
2397 return idetape_blkdev_ioctl(drive, cmd, arg); 2397 return idetape_blkdev_ioctl(drive, cmd, arg);
2398 } 2398 }
2399} 2399}
@@ -2535,7 +2535,7 @@ static int idetape_chrdev_release(struct inode *inode, struct file *filp)
2535 idetape_write_release(drive, minor); 2535 idetape_write_release(drive, minor);
2536 if (tape->chrdev_dir == IDETAPE_DIR_READ) { 2536 if (tape->chrdev_dir == IDETAPE_DIR_READ) {
2537 if (minor < 128) 2537 if (minor < 128)
2538 idetape_discard_read_pipeline(drive, 1); 2538 ide_tape_discard_merge_buffer(drive, 1);
2539 } 2539 }
2540 2540
2541 if (minor < 128 && test_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags)) 2541 if (minor < 128 && test_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags))