Lines Matching refs:tape
7 Rewritten from Dwayne Forsyth's SCSI tape driver by Kai Makisara.
94 MODULE_DESCRIPTION("SCSI tape (st) driver");
108 MODULE_PARM_DESC(try_direct_io, "Try direct I/O between user buffer and tape drive (1)");
314 static inline char *tape_name(struct scsi_tape *tape)
316 return tape->disk->disk_name;
392 if (!debugging) { /* Abnormal conditions for tape */
832 /* Flush the tape buffer. The tape will be positioned correctly unless
1040 /* See if the drive is ready and gather information about the tape. Return values:
1043 1 drive not ready (possibly no tape)
1170 DEBC_printk(STp, "Density %x, tape length: %x, "
1181 "non-buffered tape: disabling "
1216 after the driver has been initialized with tape in the drive and the
1299 "Can't allocate one page tape buffer.\n");
1347 /* Flush the tape buffer before close */
1463 accessing this tape. */
1597 "Can't allocate %d byte tape buffer.\n",
1652 "Write not multiple of tape block size.\n");
1708 the problems after some tape movement. */
1901 /* Read data from the tape. Returns zero in the normal case, one if the
2163 /* Check the buffer writability before any tape movement. Don't alter
2217 /* Change the eof state if no data from tape or buffer */
2484 /* Read a mode page into the tape buffer. The block descriptors are included
2510 /* Send the mode page in the tape buffer to the drive. Assumes that the mode data
2649 st_printk(ST_DEB_MSG, STp, "Unloading tape.\n");
2651 st_printk(ST_DEB_MSG, STp, "Loading tape.\n");
2697 st_printk(ST_DEB_MSG, STp, "Spacing tape %s over %d %s.\n",
2854 DEBC_printk(STp, "Rewinding tape.\n");
2858 DEBC_printk(STp, "No op on tape.\n");
2868 DEBC_printk(STp, "Retensioning tape.\n");
2873 /* space to the end of tape */
2902 DEBC_printk(STp, "Erasing tape.\n");
2906 case MTSETDENSITY: /* Set tape density */
3113 /* Get the tape position. If bt == 2, arg points into a kernel space mt_loc
3145 DEBC_printk(STp, " Can't read tape position.\n");
3164 DEBC_printk(STp, "Got tape pos. blk %d part %d.\n",
3174 /* Set the tape block and partition. Negative partition means that only the
3322 /* Get the number of partitions on the tape. As a side effect reads the
3323 mode page into the tape buffer. */
3369 /* Partition the tape into two partitions if size > 0 or one partition if
3424 DEBC_printk(STp, "Formatting tape with one partition.\n");
3475 DEBC_printk(STp, "Formatting tape with one partition.\n");
3485 "Formatting tape with two partitions (%i = %d MB).\n",
3505 st_printk(KERN_INFO, STp, "Partitioning of tape failed.\n");
3630 * to this device. If the user wants to rewind the tape,
3911 /* Try to allocate a new tape buffer. Calling function must not hold
3919 printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n");
3938 /* Try to allocate enough space in the tape buffer */
4030 /* Move data from the user buffer to the tape buffer. Returns zero (success) or
4062 /* Move data from the tape buffer to the user buffer. Returns zero (success) or
4206 static int create_one_cdev(struct scsi_tape *tape, int mode, int rew)
4212 struct st_modedef *STm = &(tape->modes[mode]);
4214 int dev_num = tape->index;
4238 tape->disk->disk_name, st_formats[i]);
4240 dev = device_create(&st_sysfs_class, &tape->device->sdev_gendev,
4241 cdev_devno, &tape->modes[mode], "%s", name);
4259 static int create_cdevs(struct scsi_tape *tape)
4263 error = create_one_cdev(tape, mode, 0);
4266 error = create_one_cdev(tape, mode, 1);
4271 return sysfs_create_link(&tape->device->sdev_gendev.kobj,
4272 &tape->modes[0].devs[0]->kobj, "tape");
4275 static void remove_cdevs(struct scsi_tape *tape)
4278 sysfs_remove_link(&tape->device->sdev_gendev.kobj, "tape");
4280 struct st_modedef *STm = &(tape->modes[mode]);
4318 "st: Can't allocate new tape buffer. "
4339 /* SCSI tape doesn't register this gendisk via add_disk(). Manually
4390 STm->tape = tpnt;
4437 "Attached scsi tape %s\n", tape_name(tpnt));
4690 struct scsi_tape *STp = STm->tape;
4715 /* Support for tape stats */
4718 * read_cnt_show - return read count - count of reads made from tape drive
4729 (long long)atomic64_read(&STm->tape->stats->read_cnt));
4734 * read_byte_cnt_show - return read byte count - tape drives
4736 * of data read from the tape drive.
4747 (long long)atomic64_read(&STm->tape->stats->read_byte_cnt));
4763 (long long)atomic64_read(&STm->tape->stats->tot_read_time));
4769 * to write(2) that have written data to tape.
4780 (long long)atomic64_read(&STm->tape->stats->write_cnt));
4786 * bytes written to tape.
4797 (long long)atomic64_read(&STm->tape->stats->write_byte_cnt));
4814 (long long)atomic64_read(&STm->tape->stats->tot_write_time));
4832 (long long)atomic64_read(&STm->tape->stats->in_flight));
4838 * waiting on all I/O to complete. This includes tape movement commands
4839 * such as rewinding, seeking to end of file or tape, it also includes
4840 * read and write. To determine the time spent on tape movement
4852 (long long)atomic64_read(&STm->tape->stats->tot_io_time));
4859 * Typically these are tape movement requests but will include driver
4860 * tape movement. This includes only requests issued by the st driver.
4871 (long long)atomic64_read(&STm->tape->stats->other_cnt));
4878 * block size on tape.
4889 (long long)atomic64_read(&STm->tape->stats->resid_cnt));