taglinefilesource code
STp199drivers/scsi/st.cScsi_Tape * STp;
STp202drivers/scsi/st.cSTp = &(scsi_tapes[st_nbr]);
STp203drivers/scsi/st.cif ((STp->buffer)->writing &&
STp215drivers/scsi/st.c(STp->buffer)->last_result = SCpnt->result; /* Error */
STp217drivers/scsi/st.c(STp->buffer)->last_result = INT_MAX; /* OK */
STp220drivers/scsi/st.c(STp->buffer)->last_result = SCpnt->result;
STp221drivers/scsi/st.cif ((STp->buffer)->writing) {
STp223drivers/scsi/st.c(STp->buffer)->last_result_fatal = st_chk_result(SCpnt);
STp230drivers/scsi/st.cSTp->write_pending = 0;
STp243drivers/scsi/st.cst_do_scsi(Scsi_Cmnd *SCpnt, Scsi_Tape *STp, unsigned char *cmd, int bytes,
STp247drivers/scsi/st.cif ((SCpnt = allocate_device(NULL, STp->device, 1)) == NULL) {
STp248drivers/scsi/st.cprintk(KERN_ERR "st%d: Can't get SCSI request.\n", TAPE_NR(STp->devt));
STp253drivers/scsi/st.cSTp->sem = MUTEX_LOCKED;
STp254drivers/scsi/st.cSCpnt->request.sem = &(STp->sem);
STp256drivers/scsi/st.cSCpnt->request.rq_dev = STp->devt;
STp258drivers/scsi/st.cscsi_do_cmd(SCpnt, (void *)cmd, (STp->buffer)->b_data, bytes,
STp263drivers/scsi/st.c(STp->buffer)->last_result_fatal = st_chk_result(SCpnt);
STp271drivers/scsi/st.cwrite_behind_check(Scsi_Tape *STp)
STp275drivers/scsi/st.cSTbuffer = STp->buffer;
STp278drivers/scsi/st.cif (STp->write_pending)
STp279drivers/scsi/st.cSTp->nbr_waits++;
STp281drivers/scsi/st.cSTp->nbr_finished++;
STp284drivers/scsi/st.cdown(&(STp->sem));
STp291drivers/scsi/st.cif (STp->drv_block >= 0) {
STp292drivers/scsi/st.cif (STp->block_size == 0)
STp293drivers/scsi/st.cSTp->drv_block++;
STp295drivers/scsi/st.cSTp->drv_block += STbuffer->writing / STp->block_size;
STp306drivers/scsi/st.cback_over_eof(Scsi_Tape *STp)
STp316drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, 0, ST_TIMEOUT, MAX_RETRIES);
STp321drivers/scsi/st.cif ((STp->buffer)->last_result != 0) {
STp322drivers/scsi/st.cprintk(KERN_ERR "st%d: Backing over filemark failed.\n", TAPE_NR(STp->devt));
STp323drivers/scsi/st.cif ((STp->mt_status)->mt_fileno >= 0)
STp324drivers/scsi/st.c(STp->mt_status)->mt_fileno += 1;
STp325drivers/scsi/st.c(STp->mt_status)->mt_blkno = 0;
STp328drivers/scsi/st.creturn (STp->buffer)->last_result_fatal;
STp334drivers/scsi/st.cflush_write_buffer(Scsi_Tape *STp)
STp341drivers/scsi/st.cif ((STp->buffer)->writing) {
STp342drivers/scsi/st.cwrite_behind_check(STp);
STp343drivers/scsi/st.cif ((STp->buffer)->last_result_fatal) {
STp347drivers/scsi/st.cTAPE_NR(STp->devt), (STp->buffer)->last_result);
STp349drivers/scsi/st.cif ((STp->buffer)->last_result == INT_MAX)
STp355drivers/scsi/st.cif (STp->block_size == 0)
STp359drivers/scsi/st.cif (STp->dirty == 1) {
STp361drivers/scsi/st.coffset = (STp->buffer)->buffer_bytes;
STp362drivers/scsi/st.ctransfer = ((offset + STp->block_size - 1) /
STp363drivers/scsi/st.cSTp->block_size) * STp->block_size;
STp366drivers/scsi/st.cprintk(ST_DEB_MSG "st%d: Flushing %d bytes.\n", TAPE_NR(STp->devt), transfer);
STp368drivers/scsi/st.cmemset((STp->buffer)->b_data + offset, 0, transfer - offset);
STp373drivers/scsi/st.cblks = transfer / STp->block_size;
STp378drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, transfer, ST_TIMEOUT, MAX_WRITE_RETRIES);
STp382drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp383drivers/scsi/st.cprintk(KERN_ERR "st%d: Error on flush.\n", TAPE_NR(STp->devt));
STp387drivers/scsi/st.cSTp->dirty = 0;
STp388drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp393drivers/scsi/st.cSTp->drv_block = (-1);
STp396drivers/scsi/st.cif (STp->drv_block >= 0)
STp397drivers/scsi/st.cSTp->drv_block += blks;
STp398drivers/scsi/st.cSTp->dirty = 0;
STp399drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp413drivers/scsi/st.cScsi_Tape * STp;
STp417drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp418drivers/scsi/st.cSTbuffer = STp->buffer;
STp424drivers/scsi/st.cif( STp->device->was_reset )
STp427drivers/scsi/st.cif (STp->ready != ST_READY)
STp430drivers/scsi/st.cif (STp->ps[STp->partition].rw == ST_WRITING)  /* Writing */
STp431drivers/scsi/st.creturn flush_write_buffer(STp);
STp433drivers/scsi/st.cif (STp->block_size == 0) {
STp434drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp435drivers/scsi/st.cSTp->eof_hit = 0;
STp439drivers/scsi/st.cbackspace = ((STp->buffer)->buffer_bytes +
STp440drivers/scsi/st.c(STp->buffer)->read_pointer) / STp->block_size -
STp441drivers/scsi/st.c((STp->buffer)->read_pointer + STp->block_size - 1) /
STp442drivers/scsi/st.cSTp->block_size;
STp443drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp444drivers/scsi/st.c(STp->buffer)->read_pointer = 0;
STp447drivers/scsi/st.cif ((STp->eof == ST_FM) && !STp->eof_hit) {
STp448drivers/scsi/st.cresult = back_over_eof(STp); /* Back over the EOF hit */
STp450drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp451drivers/scsi/st.cSTp->eof_hit = 0;
STp457drivers/scsi/st.celse if ((STp->eof == ST_FM) && !STp->eof_hit) {
STp458drivers/scsi/st.c(STp->mt_status)->mt_fileno++;
STp459drivers/scsi/st.cSTp->drv_block = 0;
STp468drivers/scsi/st.cset_mode_densblk(struct inode * inode, Scsi_Tape *STp, ST_mode *STm)
STp474drivers/scsi/st.cif (!STp->density_changed &&
STp476drivers/scsi/st.cSTm->default_density != STp->density) {
STp481drivers/scsi/st.carg = STp->density;
STp483drivers/scsi/st.cif (!STp->blksize_changed &&
STp485drivers/scsi/st.cSTm->default_blksize != STp->block_size) {
STp490drivers/scsi/st.carg |= STp->block_size;
STp511drivers/scsi/st.cScsi_Tape * STp;
STp518drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp519drivers/scsi/st.cif (STp->in_use) {
STp525drivers/scsi/st.cSTp->rew_at_close = (MINOR(inode->i_rdev) & 0x80) == 0;
STp527drivers/scsi/st.cif (mode != STp->current_mode) {
STp531drivers/scsi/st.cdev, STp->current_mode, mode);
STp536drivers/scsi/st.cSTp->current_mode = mode;
STp538drivers/scsi/st.cSTm = &(STp->modes[STp->current_mode]);
STp541drivers/scsi/st.cneed_dma_buffer = STp->restr_dma;
STp547drivers/scsi/st.cSTp->buffer = new_tape_buffer(FALSE, need_dma_buffer);
STp548drivers/scsi/st.cif (STp->buffer == NULL) {
STp554drivers/scsi/st.cSTp->buffer = st_buffers[i];
STp555drivers/scsi/st.c(STp->buffer)->in_use = 1;
STp556drivers/scsi/st.c(STp->buffer)->writing = 0;
STp559drivers/scsi/st.cSTp->write_prot = ((flags & O_ACCMODE) == O_RDONLY);
STp561drivers/scsi/st.cSTp->dirty = 0;
STp563drivers/scsi/st.cSTp->ps[i].rw = ST_IDLE;
STp564drivers/scsi/st.cSTp->ready = ST_READY;
STp565drivers/scsi/st.cif (STp->eof != ST_EOD)  /* Save EOD across opens */
STp566drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp567drivers/scsi/st.cSTp->eof_hit = 0;
STp568drivers/scsi/st.cSTp->recover_count = 0;
STp570drivers/scsi/st.cSTp->nbr_waits = STp->nbr_finished = 0;
STp576drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, 0, ST_LONG_TIMEOUT, MAX_READY_RETRIES);
STp582drivers/scsi/st.c(STp->mt_status)->mt_fileno = 0 ;
STp586drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 0, ST_LONG_TIMEOUT, MAX_READY_RETRIES);
STp588drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = 0;
STp589drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp590drivers/scsi/st.c(STp->device)->was_reset = 0;
STp591drivers/scsi/st.cSTp->partition = STp->new_partition = 0;
STp592drivers/scsi/st.cif (STp->can_partitions)
STp593drivers/scsi/st.cSTp->nbr_partitions = 1;  /* This guess will be updated later if necessary */
STp595drivers/scsi/st.cSTp->ps[i].rw = ST_IDLE;
STp596drivers/scsi/st.cSTp->ps[i].moves_after_eof = 1;
STp597drivers/scsi/st.cSTp->ps[i].at_sm = 0;
STp598drivers/scsi/st.cSTp->ps[i].last_block_valid = FALSE;
STp603drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp606drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = 0 ;
STp608drivers/scsi/st.cSTp->ready = ST_NO_TAPE;
STp610drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = (-1);
STp611drivers/scsi/st.cSTp->ready = ST_NOT_READY;
STp614drivers/scsi/st.cSTp->density = 0;     /* Clear the erroneous "residue" */
STp615drivers/scsi/st.cSTp->write_prot = 0;
STp616drivers/scsi/st.cSTp->block_size = 0;
STp617drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp618drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = 0;
STp619drivers/scsi/st.cSTp->partition = STp->new_partition = 0;
STp620drivers/scsi/st.cSTp->door_locked = ST_UNLOCKED;
STp621drivers/scsi/st.cSTp->in_use = 1;
STp628drivers/scsi/st.cif (STp->omit_blklims)
STp629drivers/scsi/st.cSTp->min_block = STp->max_block = (-1);
STp634drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 6, ST_TIMEOUT, MAX_READY_RETRIES);
STp637drivers/scsi/st.cSTp->max_block = ((STp->buffer)->b_data[1] << 16) |
STp638drivers/scsi/st.c((STp->buffer)->b_data[2] << 8) | (STp->buffer)->b_data[3];
STp639drivers/scsi/st.cSTp->min_block = ((STp->buffer)->b_data[4] << 8) |
STp640drivers/scsi/st.c(STp->buffer)->b_data[5];
STp643drivers/scsi/st.cprintk(ST_DEB_MSG "st%d: Block limits %d - %d bytes.\n", dev, STp->min_block,
STp644drivers/scsi/st.cSTp->max_block);
STp648drivers/scsi/st.cSTp->min_block = STp->max_block = (-1);
STp660drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 12, ST_TIMEOUT, MAX_READY_RETRIES);
STp662drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp667drivers/scsi/st.cSTp->block_size = ST_DEFAULT_BLOCK;  /* Educated guess (?) */
STp668drivers/scsi/st.c(STp->buffer)->last_result_fatal = 0;  /* Prevent error propagation */
STp669drivers/scsi/st.cSTp->drv_write_prot = 0;
STp677drivers/scsi/st.c(STp->buffer)->b_data[0], (STp->buffer)->b_data[1],
STp678drivers/scsi/st.c(STp->buffer)->b_data[2], (STp->buffer)->b_data[3]);
STp681drivers/scsi/st.cif ((STp->buffer)->b_data[3] >= 8) {
STp682drivers/scsi/st.cSTp->drv_buffer = ((STp->buffer)->b_data[2] >> 4) & 7;
STp683drivers/scsi/st.cSTp->density = (STp->buffer)->b_data[4];
STp684drivers/scsi/st.cSTp->block_size = (STp->buffer)->b_data[9] * 65536 +
STp685drivers/scsi/st.c(STp->buffer)->b_data[10] * 256 + (STp->buffer)->b_data[11];
STp689drivers/scsi/st.cdev, STp->density, (STp->buffer)->b_data[5] * 65536 +
STp690drivers/scsi/st.c(STp->buffer)->b_data[6] * 256 + (STp->buffer)->b_data[7],
STp691drivers/scsi/st.cSTp->drv_buffer);
STp695drivers/scsi/st.cif (STp->block_size > (STp->buffer)->buffer_size &&
STp696drivers/scsi/st.c!enlarge_buffer(STp->buffer, STp->block_size, STp->restr_dma)) {
STp698drivers/scsi/st.cSTp->block_size);
STp699drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp700drivers/scsi/st.cSTp->buffer = NULL;
STp703drivers/scsi/st.cSTp->drv_write_prot = ((STp->buffer)->b_data[2] & 0x80) != 0;
STp707drivers/scsi/st.cif (STp->block_size > 0)
STp708drivers/scsi/st.c(STp->buffer)->buffer_blocks = st_buffer_size / STp->block_size;
STp710drivers/scsi/st.c(STp->buffer)->buffer_blocks = 1;
STp711drivers/scsi/st.c(STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0;
STp716drivers/scsi/st.cSTp->block_size, (STp->buffer)->buffer_size,
STp717drivers/scsi/st.c(STp->buffer)->buffer_blocks);
STp720drivers/scsi/st.cif (STp->drv_write_prot) {
STp721drivers/scsi/st.cSTp->write_prot = 1;
STp727drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp728drivers/scsi/st.cSTp->buffer = NULL;
STp733drivers/scsi/st.cif (STp->can_partitions && STp->nbr_partitions < 1) {
STp741drivers/scsi/st.cif ((STp->partition = find_partition(inode)) < 0) {
STp742drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp743drivers/scsi/st.cSTp->buffer = NULL;
STp744drivers/scsi/st.creturn STp->partition;
STp746drivers/scsi/st.cSTp->new_partition = STp->partition;
STp747drivers/scsi/st.cSTp->nbr_partitions = 1;  /* This guess will be updated when necessary */
STp751drivers/scsi/st.cSTp->density_changed = STp->blksize_changed = FALSE;
STp752drivers/scsi/st.cSTp->compression_changed = FALSE;
STp754drivers/scsi/st.c(i = set_mode_densblk(inode, STp, STm)) < 0) {
STp755drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp756drivers/scsi/st.cSTp->buffer = NULL;
STp759drivers/scsi/st.cif (STp->default_drvbuffer != 0xff) {
STp760drivers/scsi/st.cif (st_int_ioctl(inode, MTSETDRVBUFFER, STp->default_drvbuffer))
STp762drivers/scsi/st.cdev, STp->default_drvbuffer);
STp766drivers/scsi/st.cSTp->in_use = 1;
STp782drivers/scsi/st.cScsi_Tape * STp;
STp787drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp789drivers/scsi/st.cif (STp->can_partitions &&
STp798drivers/scsi/st.cif ( STp->ps[STp->partition].rw == ST_WRITING && !(STp->device)->was_reset) {
STp800drivers/scsi/st.cresult = flush_write_buffer(STp);
STp807drivers/scsi/st.cdev, STp->nbr_waits, STp->nbr_finished);
STp815drivers/scsi/st.ccmd[4] = 1 + STp->two_fm;
STp817drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, 0, ST_TIMEOUT, MAX_WRITE_RETRIES);
STp823drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0)
STp826drivers/scsi/st.cif ((STp->mt_status)->mt_fileno >= 0)
STp827drivers/scsi/st.c(STp->mt_status)->mt_fileno++ ;
STp828drivers/scsi/st.cSTp->drv_block = 0;
STp829drivers/scsi/st.cif (STp->two_fm)
STp830drivers/scsi/st.cback_over_eof(STp);
STp840drivers/scsi/st.celse if (!STp->rew_at_close) {
STp841drivers/scsi/st.cif (STp->can_bsr)
STp843drivers/scsi/st.celse if ((STp->eof == ST_FM) && !STp->eof_hit)
STp844drivers/scsi/st.cback_over_eof(STp);
STp848drivers/scsi/st.cif (STp->rew_at_close)
STp851drivers/scsi/st.cif (STp->door_locked == ST_LOCKED_AUTO)
STp854drivers/scsi/st.cif (STp->buffer != NULL) {
STp855drivers/scsi/st.cnormalize_buffer(STp->buffer);
STp856drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp859drivers/scsi/st.cSTp->in_use = 0;
STp878drivers/scsi/st.cScsi_Tape * STp;
STp883drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp884drivers/scsi/st.cif (STp->ready != ST_READY)
STp886drivers/scsi/st.cSTm = &(STp->modes[STp->current_mode]);
STp894drivers/scsi/st.cif( STp->device->was_reset )
STp898drivers/scsi/st.cif (!STp->in_use) {
STp904drivers/scsi/st.cif (STp->can_partitions &&
STp907drivers/scsi/st.cSTps = &(STp->ps[STp->partition]);
STp909drivers/scsi/st.cif (STp->write_prot)
STp912drivers/scsi/st.cif (STp->block_size == 0 &&
STp913drivers/scsi/st.ccount > (STp->buffer)->buffer_size &&
STp914drivers/scsi/st.c!enlarge_buffer(STp->buffer, count, STp->restr_dma))
STp917drivers/scsi/st.cif (STp->do_auto_lock && STp->door_locked == ST_UNLOCKED &&
STp919drivers/scsi/st.cSTp->door_locked = ST_LOCKED_AUTO;
STp928drivers/scsi/st.c(STp->mt_status)->mt_fileno == 0 && STp->drv_block == 0) {
STp929drivers/scsi/st.cif ((retval = set_mode_densblk(inode, STp, STm)) < 0)
STp932drivers/scsi/st.c!(STp->compression_changed)) {
STp933drivers/scsi/st.cif (st_compression(STp, (STm->default_compression == ST_YES))) {
STp945drivers/scsi/st.cif ((STp->buffer)->writing) {
STp946drivers/scsi/st.cwrite_behind_check(STp);
STp947drivers/scsi/st.cif ((STp->buffer)->last_result_fatal) {
STp951drivers/scsi/st.c(STp->buffer)->last_result);
STp953drivers/scsi/st.cif ((STp->buffer)->last_result == INT_MAX) {
STp955drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp962drivers/scsi/st.cif (STp->eof == ST_EOM_OK)
STp964drivers/scsi/st.celse if (STp->eof == ST_EOM_ERROR)
STp968drivers/scsi/st.cif (STp->block_size != 0 && (count % STp->block_size) != 0)
STp973drivers/scsi/st.cwrite_threshold = (STp->buffer)->buffer_blocks * STp->block_size;
STp981drivers/scsi/st.ccmd[1] = (STp->block_size != 0);
STp986drivers/scsi/st.cwhile((STp->block_size == 0 && !STm->do_async_writes && count > 0) ||
STp987drivers/scsi/st.c(STp->block_size != 0 &&
STp988drivers/scsi/st.c(STp->buffer)->buffer_bytes + count > write_threshold))
STp991drivers/scsi/st.cif (STp->block_size == 0)
STp994drivers/scsi/st.cdo_count = (STp->buffer)->buffer_blocks * STp->block_size -
STp995drivers/scsi/st.c(STp->buffer)->buffer_bytes;
STp999drivers/scsi/st.cmemcpy_fromfs((STp->buffer)->b_data +
STp1000drivers/scsi/st.c(STp->buffer)->buffer_bytes, b_point, do_count);
STp1002drivers/scsi/st.cif (STp->block_size == 0)
STp1005drivers/scsi/st.cblks = ((STp->buffer)->buffer_bytes + do_count) /
STp1006drivers/scsi/st.cSTp->block_size;
STp1007drivers/scsi/st.ctransfer = blks * STp->block_size;
STp1013drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, transfer, ST_TIMEOUT, MAX_WRITE_RETRIES);
STp1017drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp1024drivers/scsi/st.cif (STp->block_size != 0 && (SCpnt->sense_buffer[0] & 0x80) != 0)
STp1028drivers/scsi/st.celse if (STp->block_size == 0 &&
STp1033drivers/scsi/st.cif (STp->block_size != 0)
STp1034drivers/scsi/st.ctransfer *= STp->block_size;
STp1038drivers/scsi/st.cif (STp->drv_block >= 0) {
STp1039drivers/scsi/st.cif (STp->block_size == 0 && transfer < do_count)
STp1040drivers/scsi/st.cSTp->drv_block++;
STp1041drivers/scsi/st.celse if (STp->block_size != 0)
STp1042drivers/scsi/st.cSTp->drv_block += (do_count - transfer) / STp->block_size;
STp1044drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp1053drivers/scsi/st.cSTp->eof = ST_EOM_ERROR;
STp1054drivers/scsi/st.cSTp->drv_block = (-1);    /* Too cautious? */
STp1063drivers/scsi/st.cSTp->drv_block = (-1);    /* Too cautious? */
STp1068drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp1069drivers/scsi/st.cSTp->dirty = 0;
STp1078drivers/scsi/st.cif (STp->drv_block >= 0) {
STp1079drivers/scsi/st.cif (STp->block_size == 0)
STp1080drivers/scsi/st.cSTp->drv_block++;
STp1082drivers/scsi/st.cSTp->drv_block += blks;
STp1084drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp1085drivers/scsi/st.cSTp->dirty = 0;
STp1088drivers/scsi/st.cSTp->dirty = 1;
STp1089drivers/scsi/st.cmemcpy_fromfs((STp->buffer)->b_data +
STp1090drivers/scsi/st.c(STp->buffer)->buffer_bytes,b_point,count);
STp1092drivers/scsi/st.c(STp->buffer)->buffer_bytes += count;
STp1096drivers/scsi/st.cif (doing_write && (STp->buffer)->last_result_fatal != 0) {
STp1098drivers/scsi/st.creturn (STp->buffer)->last_result_fatal;
STp1102drivers/scsi/st.c((STp->buffer)->buffer_bytes >= STp->write_threshold ||
STp1103drivers/scsi/st.cSTp->block_size == 0) ) {
STp1106drivers/scsi/st.cSCpnt = allocate_device(NULL, STp->device, 1);
STp1110drivers/scsi/st.cif (STp->block_size == 0)
STp1111drivers/scsi/st.c(STp->buffer)->writing = (STp->buffer)->buffer_bytes;
STp1113drivers/scsi/st.c(STp->buffer)->writing = ((STp->buffer)->buffer_bytes /
STp1114drivers/scsi/st.cSTp->block_size) * STp->block_size;
STp1115drivers/scsi/st.cSTp->dirty = !((STp->buffer)->writing ==
STp1116drivers/scsi/st.c(STp->buffer)->buffer_bytes);
STp1118drivers/scsi/st.cif (STp->block_size == 0)
STp1119drivers/scsi/st.cblks = (STp->buffer)->writing;
STp1121drivers/scsi/st.cblks = (STp->buffer)->writing / STp->block_size;
STp1125drivers/scsi/st.cSTp->sem = MUTEX_LOCKED;
STp1126drivers/scsi/st.cSCpnt->request.sem = &(STp->sem);
STp1128drivers/scsi/st.cSCpnt->request.rq_dev = STp->devt;
STp1130drivers/scsi/st.cSTp->write_pending = 1;
STp1134drivers/scsi/st.c(void *) cmd, (STp->buffer)->b_data,
STp1135drivers/scsi/st.c(STp->buffer)->writing,
STp1154drivers/scsi/st.cScsi_Tape * STp;
STp1159drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp1160drivers/scsi/st.cif (STp->ready != ST_READY)
STp1162drivers/scsi/st.cSTm = &(STp->modes[STp->current_mode]);
STp1166drivers/scsi/st.cif (!STp->in_use) {
STp1172drivers/scsi/st.cif (STp->can_partitions &&
STp1175drivers/scsi/st.cSTps = &(STp->ps[STp->partition]);
STp1177drivers/scsi/st.cif (STp->block_size == 0 &&
STp1178drivers/scsi/st.ccount > (STp->buffer)->buffer_size &&
STp1179drivers/scsi/st.c!enlarge_buffer(STp->buffer, count, STp->restr_dma))
STp1182drivers/scsi/st.cif (!(STm->do_read_ahead) && STp->block_size != 0 &&
STp1183drivers/scsi/st.c(count % STp->block_size) != 0)
STp1186drivers/scsi/st.cif (STp->do_auto_lock && STp->door_locked == ST_UNLOCKED &&
STp1188drivers/scsi/st.cSTp->door_locked = ST_LOCKED_AUTO;
STp1200drivers/scsi/st.cif (debugging && STp->eof != ST_NOEOF)
STp1202drivers/scsi/st.c(STp->buffer)->buffer_bytes);
STp1204drivers/scsi/st.cif (((STp->buffer)->buffer_bytes == 0) &&
STp1205drivers/scsi/st.c(STp->eof == ST_EOM_OK || STp->eof == ST_EOD))
STp1212drivers/scsi/st.cif ((STp->buffer)->buffer_bytes == 0 &&
STp1213drivers/scsi/st.cSTp->eof == ST_NOEOF) {
STp1217drivers/scsi/st.ccmd[1] = (STp->block_size != 0);
STp1218drivers/scsi/st.cif (STp->block_size == 0)
STp1222drivers/scsi/st.cblks = (STp->buffer)->buffer_blocks;
STp1223drivers/scsi/st.cbytes = blks * STp->block_size;
STp1227drivers/scsi/st.cif (bytes > (STp->buffer)->buffer_size)
STp1228drivers/scsi/st.cbytes = (STp->buffer)->buffer_size;
STp1229drivers/scsi/st.cblks = bytes / STp->block_size;
STp1230drivers/scsi/st.cbytes = blks * STp->block_size;
STp1237drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, bytes, ST_TIMEOUT, MAX_RETRIES);
STp1241drivers/scsi/st.c(STp->buffer)->read_pointer = 0;
STp1242drivers/scsi/st.cSTp->eof_hit = 0;
STp1245drivers/scsi/st.cif ((STp->buffer)->last_result_fatal) {
STp1265drivers/scsi/st.cif (STp->block_size == 0 &&
STp1270drivers/scsi/st.cif (STp->block_size == 0) {
STp1273drivers/scsi/st.c(STp->buffer)->buffer_bytes = bytes - transfer;
STp1279drivers/scsi/st.cif (STp->drv_block >= 0)
STp1280drivers/scsi/st.cSTp->drv_block += blks - transfer + 1;
STp1285drivers/scsi/st.c(STp->buffer)->buffer_bytes = (blks - transfer) * STp->block_size;
STp1289drivers/scsi/st.cdev, count - total, (STp->buffer)->buffer_bytes);
STp1291drivers/scsi/st.cif (count - total > (STp->buffer)->buffer_bytes)
STp1292drivers/scsi/st.ccount = total + (STp->buffer)->buffer_bytes;
STp1293drivers/scsi/st.cif (STp->drv_block >= 0)
STp1294drivers/scsi/st.cSTp->drv_block += 1;
STp1301drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp1302drivers/scsi/st.cif (STp->block_size == 0)
STp1303drivers/scsi/st.c(STp->buffer)->buffer_bytes = bytes - transfer;
STp1305drivers/scsi/st.c(STp->buffer)->buffer_bytes =
STp1306drivers/scsi/st.cbytes - transfer * STp->block_size;
STp1310drivers/scsi/st.c(STp->buffer)->buffer_bytes);
STp1314drivers/scsi/st.cSTp->eof = ST_FM;
STp1315drivers/scsi/st.cif (STp->block_size == 0)
STp1316drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp1318drivers/scsi/st.c(STp->buffer)->buffer_bytes =
STp1319drivers/scsi/st.cbytes - transfer * STp->block_size;
STp1324drivers/scsi/st.cdev, (STp->buffer)->buffer_bytes, total);
STp1334drivers/scsi/st.cSTp->drv_block = (-1);
STp1345drivers/scsi/st.cSTp->eof = ST_EOD;
STp1353drivers/scsi/st.ctransfer = (STp->buffer)->last_result_fatal;
STp1359drivers/scsi/st.c(STp->buffer)->buffer_bytes = bytes;
STp1361drivers/scsi/st.cif (STp->drv_block >= 0) {
STp1362drivers/scsi/st.cif (STp->block_size == 0)
STp1363drivers/scsi/st.cSTp->drv_block++;
STp1365drivers/scsi/st.cSTp->drv_block += (STp->buffer)->buffer_bytes / STp->block_size;
STp1371drivers/scsi/st.cif ((STp->buffer)->buffer_bytes > 0) {
STp1373drivers/scsi/st.cif (debugging && STp->eof != ST_NOEOF)
STp1375drivers/scsi/st.c(STp->buffer)->buffer_bytes, count - total);
STp1377drivers/scsi/st.ctransfer = (STp->buffer)->buffer_bytes < count - total ?
STp1378drivers/scsi/st.c(STp->buffer)->buffer_bytes : count - total;
STp1379drivers/scsi/st.cmemcpy_tofs(buf, (STp->buffer)->b_data +
STp1380drivers/scsi/st.c(STp->buffer)->read_pointer,transfer);
STp1384drivers/scsi/st.c(STp->buffer)->buffer_bytes -= transfer;
STp1385drivers/scsi/st.c(STp->buffer)->read_pointer += transfer;
STp1387drivers/scsi/st.celse if (STp->eof != ST_NOEOF) {
STp1388drivers/scsi/st.cSTp->eof_hit = 1;
STp1391drivers/scsi/st.cif (total == 0 && STp->eof == ST_FM) {
STp1392drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp1393drivers/scsi/st.cSTp->drv_block = 0;
STp1396drivers/scsi/st.cif ((STp->mt_status)->mt_fileno >= 0)
STp1397drivers/scsi/st.c(STp->mt_status)->mt_fileno++;
STp1399drivers/scsi/st.cif (total == 0 && STp->eof == ST_EOM_OK)
STp1404drivers/scsi/st.cif (STp->block_size == 0)
STp1419drivers/scsi/st.cst_log_options(Scsi_Tape *STp, ST_mode *STm, int dev)
STp1423drivers/scsi/st.cdev, STp->current_mode, STm->do_buffer_writes, STm->do_async_writes,
STp1427drivers/scsi/st.cdev, STp->can_bsr, STp->two_fm, STp->fast_mteom, STp->do_auto_lock);
STp1430drivers/scsi/st.cdev, STm->defaults_for_writes, STp->omit_blklims, STp->can_partitions,
STp1431drivers/scsi/st.cSTp->scsi2_logical);
STp1445drivers/scsi/st.cScsi_Tape *STp;
STp1449drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp1450drivers/scsi/st.cSTm = &(STp->modes[STp->current_mode]);
STp1452drivers/scsi/st.cmemcpy(STm, &(STp->modes[0]), sizeof(ST_mode));
STp1457drivers/scsi/st.cdev, STp->current_mode);
STp1467drivers/scsi/st.cSTp->two_fm      = (options & MT_ST_TWO_FM) != 0;
STp1468drivers/scsi/st.cSTp->fast_mteom    = (options & MT_ST_FAST_MTEOM) != 0;
STp1469drivers/scsi/st.cSTp->do_auto_lock     = (options & MT_ST_AUTO_LOCK) != 0;
STp1470drivers/scsi/st.cSTp->can_bsr          = (options & MT_ST_CAN_BSR) != 0;
STp1471drivers/scsi/st.cSTp->omit_blklims    = (options & MT_ST_NO_BLKLIMS) != 0;
STp1472drivers/scsi/st.cif ((STp->device)->scsi_level >= SCSI_2)
STp1473drivers/scsi/st.cSTp->can_partitions = (options & MT_ST_CAN_PARTITIONS) != 0;
STp1474drivers/scsi/st.cSTp->scsi2_logical    = (options & MT_ST_SCSI2LOGICAL) != 0;
STp1478drivers/scsi/st.cst_log_options(STp, STm, dev);
STp1491drivers/scsi/st.cSTp->two_fm = value;
STp1493drivers/scsi/st.cSTp->fast_mteom = value;
STp1495drivers/scsi/st.cSTp->do_auto_lock = value;
STp1497drivers/scsi/st.cSTp->can_bsr = value;
STp1499drivers/scsi/st.cSTp->omit_blklims = value;
STp1500drivers/scsi/st.cif ((STp->device)->scsi_level >= SCSI_2 &&
STp1502drivers/scsi/st.cSTp->can_partitions = value;
STp1504drivers/scsi/st.cSTp->scsi2_logical = value;
STp1509drivers/scsi/st.cst_log_options(STp, STm, dev);
STp1518drivers/scsi/st.cSTp->write_threshold = value;
STp1550drivers/scsi/st.cSTp->default_drvbuffer = 0xff;
STp1554drivers/scsi/st.cSTp->default_drvbuffer = value & 7;
STp1556drivers/scsi/st.cdev, STp->default_drvbuffer);
STp1590drivers/scsi/st.cst_compression(Scsi_Tape * STp, int state)
STp1596drivers/scsi/st.cif (STp->ready != ST_READY)
STp1606drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, cmd[4], ST_TIMEOUT, 0);
STp1611drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp1622drivers/scsi/st.c((STp->buffer)->b_data[MODE_HEADER_LENGTH + 2] & DCE_MASK ? 1 : 0));
STp1626drivers/scsi/st.cif (((STp->buffer)->b_data[MODE_HEADER_LENGTH + 2] & DCC_MASK) == 0) {
STp1637drivers/scsi/st.c(STp->buffer)->b_data[MODE_HEADER_LENGTH + 2] |= DCE_MASK;
STp1639drivers/scsi/st.c(STp->buffer)->b_data[MODE_HEADER_LENGTH + 2] &= ~DCE_MASK;
STp1646drivers/scsi/st.c(STp->buffer)->b_data[0] = 0;  /* Reserved data length */
STp1647drivers/scsi/st.c(STp->buffer)->b_data[1] = 0;  /* Reserved media type byte */
STp1648drivers/scsi/st.c(STp->buffer)->b_data[MODE_HEADER_LENGTH] &= 0x3f;
STp1649drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, cmd[4], ST_TIMEOUT, 0);
STp1651drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp1667drivers/scsi/st.cSTp->compression_changed = TRUE;
STp1682drivers/scsi/st.cScsi_Tape * STp;
STp1687drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp1688drivers/scsi/st.cif (STp->ready != ST_READY && cmd_in != MTLOAD)
STp1690drivers/scsi/st.cSTps = &(STp->ps[STp->partition]);
STp1691drivers/scsi/st.cfileno = (STp->mt_status)->mt_fileno ;
STp1692drivers/scsi/st.cblkno = STp->drv_block;
STp1810drivers/scsi/st.cif (STp->write_prot)
STp1889drivers/scsi/st.cif (!STp->fast_mteom) {
STp1892drivers/scsi/st.cfileno = (STp->mt_status)->mt_fileno ;
STp1893drivers/scsi/st.cif (STp->eof == ST_EOD || STp->eof == ST_EOM_OK)
STp1912drivers/scsi/st.cif (STp->write_prot)
STp1948drivers/scsi/st.cif (STp->dirty || (STp->buffer)->buffer_bytes != 0)
STp1952drivers/scsi/st.c((arg & MT_ST_BLKSIZE_MASK) < STp->min_block ||
STp1953drivers/scsi/st.c(arg & MT_ST_BLKSIZE_MASK) > STp->max_block ||
STp1961drivers/scsi/st.cmemset((STp->buffer)->b_data, 0, 12);
STp1963drivers/scsi/st.c(STp->buffer)->b_data[2] = (arg & 7) << 4;
STp1965drivers/scsi/st.c(STp->buffer)->b_data[2] = 
STp1966drivers/scsi/st.cSTp->drv_buffer << 4;
STp1967drivers/scsi/st.c(STp->buffer)->b_data[3] = 8;     /* block descriptor length */
STp1969drivers/scsi/st.c(STp->buffer)->b_data[4] = arg;
STp1970drivers/scsi/st.cSTp->density_changed = TRUE;  /* At least we tried ;-) */
STp1973drivers/scsi/st.c(STp->buffer)->b_data[4] = arg >> 24;
STp1975drivers/scsi/st.c(STp->buffer)->b_data[4] = STp->density;
STp1979drivers/scsi/st.cSTp->blksize_changed = TRUE;  /* At least we tried ;-) */
STp1982drivers/scsi/st.cltmp = STp->block_size;
STp1983drivers/scsi/st.c(STp->buffer)->b_data[9] = (ltmp >> 16);
STp1984drivers/scsi/st.c(STp->buffer)->b_data[10] = (ltmp >> 8);
STp1985drivers/scsi/st.c(STp->buffer)->b_data[11] = ltmp;
STp1991drivers/scsi/st.c(STp->buffer)->b_data[9] * 65536 +
STp1992drivers/scsi/st.c(STp->buffer)->b_data[10] * 256 +
STp1993drivers/scsi/st.c(STp->buffer)->b_data[11]);
STp1996drivers/scsi/st.c(STp->buffer)->b_data[4]);
STp1999drivers/scsi/st.c((STp->buffer)->b_data[2] >> 4) & 7);
STp2007drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, datalen, timeout, MAX_RETRIES);
STp2011drivers/scsi/st.cioctl_result = (STp->buffer)->last_result_fatal;
STp2020drivers/scsi/st.cSTp->drv_block = blkno;
STp2021drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno;
STp2024drivers/scsi/st.cSTp->door_locked = ST_LOCKED_EXPLICIT;
STp2026drivers/scsi/st.cSTp->door_locked = ST_UNLOCKED;
STp2032drivers/scsi/st.cSTp->block_size = arg & MT_ST_BLKSIZE_MASK;
STp2033drivers/scsi/st.cif (STp->block_size != 0)
STp2034drivers/scsi/st.c(STp->buffer)->buffer_blocks =
STp2035drivers/scsi/st.c(STp->buffer)->buffer_size / STp->block_size;
STp2036drivers/scsi/st.c(STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0;
STp2039drivers/scsi/st.cSTp->drv_buffer = (arg & 7);
STp2041drivers/scsi/st.cSTp->density = arg;
STp2043drivers/scsi/st.cSTp->eof = ST_EOD;
STp2044drivers/scsi/st.cSTp->eof_hit = 0;
STp2047drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp2048drivers/scsi/st.cSTp->eof_hit = 0;
STp2051drivers/scsi/st.cSTp->density = arg >> MT_ST_DENSITY_SHIFT;
STp2053drivers/scsi/st.cSTp->rew_at_close = 0;
STp2055drivers/scsi/st.cSTp->rew_at_close = (MINOR(inode->i_rdev) & 0x80) == 0;
STp2057drivers/scsi/st.cSTp->ps[i].rw = ST_IDLE;
STp2058drivers/scsi/st.cSTp->ps[i].moves_after_eof = 1;
STp2059drivers/scsi/st.cSTp->ps[i].last_block_valid = FALSE;
STp2061drivers/scsi/st.cSTp->partition = 0;
STp2067drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp2068drivers/scsi/st.cSTp->eof_hit = 0;
STp2069drivers/scsi/st.cSTp->drv_block = 0;
STp2078drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno - undone ;
STp2080drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno;
STp2081drivers/scsi/st.cSTp->drv_block = 0;
STp2084drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno + undone ;
STp2085drivers/scsi/st.cSTp->drv_block = 0;
STp2089drivers/scsi/st.c(STp->mt_status)->mt_fileno++;
STp2090drivers/scsi/st.cSTp->drv_block = 0;
STp2094drivers/scsi/st.cSTp->drv_block = blkno - undone;
STp2096drivers/scsi/st.cSTp->drv_block = (-1);
STp2101drivers/scsi/st.c(STp->mt_status)->mt_fileno--;
STp2102drivers/scsi/st.cSTp->drv_block = (-1);
STp2106drivers/scsi/st.cSTp->drv_block = blkno + undone;
STp2108drivers/scsi/st.cSTp->drv_block = (-1);
STp2112drivers/scsi/st.c(STp->mt_status)->mt_fileno = (-1);
STp2113drivers/scsi/st.cSTp->drv_block = (-1);
STp2115drivers/scsi/st.cif (STp->eof == ST_NOEOF &&
STp2117drivers/scsi/st.cSTp->eof = ST_EOD;
STp2119drivers/scsi/st.cSTp->door_locked = ST_LOCK_FAILS;
STp2133drivers/scsi/st.cScsi_Tape *STp;
STp2139drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp2140drivers/scsi/st.cif (STp->ready != ST_READY)
STp2144drivers/scsi/st.cif ((STp->device)->scsi_level < SCSI_2) {
STp2150drivers/scsi/st.cif (!logical && !STp->scsi2_logical)
STp2153drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, scmd, 20, ST_TIMEOUT, MAX_READY_RETRIES);
STp2157drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0 ||
STp2158drivers/scsi/st.c((STp->buffer)->b_data[0] & 4)) {
STp2168drivers/scsi/st.cif ((STp->device)->scsi_level < SCSI_2) {
STp2169drivers/scsi/st.c*block = ((STp->buffer)->b_data[0] << 16) 
STp2170drivers/scsi/st.c+ ((STp->buffer)->b_data[1] << 8) 
STp2171drivers/scsi/st.c+ (STp->buffer)->b_data[2];
STp2175drivers/scsi/st.c*block = ((STp->buffer)->b_data[4] << 24)
STp2176drivers/scsi/st.c+ ((STp->buffer)->b_data[5] << 16) 
STp2177drivers/scsi/st.c+ ((STp->buffer)->b_data[6] << 8) 
STp2178drivers/scsi/st.c+ (STp->buffer)->b_data[7];
STp2179drivers/scsi/st.c*partition = (STp->buffer)->b_data[1];
STp2180drivers/scsi/st.cif (((STp->buffer)->b_data[0] & 0x80) &&
STp2181drivers/scsi/st.c(STp->buffer)->b_data[1] == 0) /* BOP of partition 0 */
STp2182drivers/scsi/st.cSTp->drv_block = (STp->mt_status)->mt_fileno = 0;
STp2203drivers/scsi/st.cScsi_Tape *STp;
STp2212drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp2213drivers/scsi/st.cif (STp->ready != ST_READY)
STp2215drivers/scsi/st.cSTps = &(STp->ps[STp->partition]);
STp2226drivers/scsi/st.cif ((!STp->can_partitions && partition != 0) ||
STp2229drivers/scsi/st.cif (partition != STp->partition) {
STp2238drivers/scsi/st.cdev, blk, STp->partition);
STp2244drivers/scsi/st.cif ((STp->device)->scsi_level < SCSI_2) {
STp2257drivers/scsi/st.cif (!logical && !STp->scsi2_logical)
STp2259drivers/scsi/st.cif (STp->partition != partition) {
STp2265drivers/scsi/st.cdev, STp->partition, partition);
STp2274drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, scmd, 20, timeout, MAX_READY_RETRIES);
STp2278drivers/scsi/st.cSTp->drv_block = (STp->mt_status)->mt_fileno = (-1);
STp2279drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp2281drivers/scsi/st.cif (STp->can_partitions &&
STp2282drivers/scsi/st.c(STp->device)->scsi_level >= SCSI_2 &&
STp2284drivers/scsi/st.cSTp->partition = p;
STp2287drivers/scsi/st.cif (STp->can_partitions) {
STp2288drivers/scsi/st.cSTp->partition = partition;
STp2289drivers/scsi/st.cSTps = &(STp->ps[partition]);
STp2300drivers/scsi/st.cSTp->drv_block = (STp->mt_status)->mt_fileno = 0;
STp2330drivers/scsi/st.cScsi_Tape *STp;
STp2333drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp2334drivers/scsi/st.cif (STp->partition == STp->new_partition)
STp2336drivers/scsi/st.cSTps = &(STp->ps[STp->new_partition]);
STp2339drivers/scsi/st.creturn set_location(inode, STps->last_block_visited, STp->new_partition, 1);
STp2354drivers/scsi/st.cScsi_Tape *STp;
STp2358drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp2359drivers/scsi/st.cif (STp->ready != ST_READY)
STp2368drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 200, ST_TIMEOUT, MAX_READY_RETRIES);
STp2373drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp2381drivers/scsi/st.cresult = (STp->buffer)->b_data[MODE_HEADER_LENGTH + 3] + 1;
STp2399drivers/scsi/st.cScsi_Tape *STp;
STp2405drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp2408drivers/scsi/st.cbp = &((STp->buffer)->b_data[0]);
STp2442drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, cmd[4], ST_LONG_TIMEOUT, MAX_READY_RETRIES);
STp2447drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp2468drivers/scsi/st.cScsi_Tape *STp;
STp2473drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp2475drivers/scsi/st.cif (debugging && !STp->in_use) {
STp2480drivers/scsi/st.cSTm = &(STp->modes[STp->current_mode]);
STp2481drivers/scsi/st.cSTps = &(STp->ps[STp->partition]);
STp2504drivers/scsi/st.cif (!(STp->device)->was_reset) {
STp2506drivers/scsi/st.cif (STp->eof_hit) {
STp2509drivers/scsi/st.c(STp->mt_status)->mt_fileno += 1;
STp2513drivers/scsi/st.c(STp->mt_status)->mt_fileno += 1;
STp2538drivers/scsi/st.cSTp->device->was_reset = 0;
STp2539drivers/scsi/st.cif (STp->door_locked != ST_UNLOCKED &&
STp2540drivers/scsi/st.cSTp->door_locked != ST_LOCK_FAILS) {
STp2544drivers/scsi/st.cSTp->door_locked = ST_UNLOCKED;
STp2555drivers/scsi/st.cif (mtc.mt_op == MTOFFL && STp->door_locked != ST_UNLOCKED)
STp2562drivers/scsi/st.cif (!STp->can_partitions ||
STp2565drivers/scsi/st.cif (mtc.mt_count >= STp->nbr_partitions &&
STp2566drivers/scsi/st.c(STp->nbr_partitions = nbr_partitions(inode)) < 0)
STp2568drivers/scsi/st.cif (mtc.mt_count >= STp->nbr_partitions)
STp2570drivers/scsi/st.cSTp->new_partition = mtc.mt_count;
STp2574drivers/scsi/st.cif (!STp->can_partitions)
STp2580drivers/scsi/st.cSTp->ps[i].rw = ST_IDLE;
STp2581drivers/scsi/st.cSTp->ps[i].moves_after_eof = 1;
STp2582drivers/scsi/st.cSTp->ps[i].at_sm = 0;
STp2583drivers/scsi/st.cSTp->ps[i].last_block_valid = FALSE;
STp2585drivers/scsi/st.cSTp->partition = STp->new_partition = 0;
STp2586drivers/scsi/st.cSTp->nbr_partitions = 1;  /* Bad guess ?-) */
STp2587drivers/scsi/st.cSTp->drv_block = (STp->mt_status)->mt_fileno = 0;
STp2591drivers/scsi/st.ci = set_location(inode, mtc.mt_count, STp->new_partition, 0);
STp2592drivers/scsi/st.cif (!STp->can_partitions)
STp2593drivers/scsi/st.cSTp->ps[0].rw = ST_IDLE;
STp2596drivers/scsi/st.cif (STp->can_partitions && STp->ready == ST_READY &&
STp2600drivers/scsi/st.creturn st_compression(STp, (mtc.mt_count & 1));
STp2610drivers/scsi/st.cif (STp->can_partitions &&
STp2622drivers/scsi/st.c(STp->mt_status)->mt_dsreg =
STp2623drivers/scsi/st.c((STp->block_size << MT_ST_BLKSIZE_SHIFT) & MT_ST_BLKSIZE_MASK) |
STp2624drivers/scsi/st.c((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK);
STp2625drivers/scsi/st.c(STp->mt_status)->mt_blkno = STp->drv_block;
STp2626drivers/scsi/st.cif (STp->block_size != 0) {
STp2628drivers/scsi/st.c(STp->mt_status)->mt_blkno +=
STp2629drivers/scsi/st.c(STp->buffer)->buffer_bytes / STp->block_size;
STp2631drivers/scsi/st.c(STp->mt_status)->mt_blkno -= ((STp->buffer)->buffer_bytes +
STp2632drivers/scsi/st.cSTp->block_size - 1) / STp->block_size;
STp2635drivers/scsi/st.c(STp->mt_status)->mt_gstat = 0;
STp2636drivers/scsi/st.cif (STp->drv_write_prot)
STp2637drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_WR_PROT(0xffffffff);
STp2638drivers/scsi/st.cif ((STp->mt_status)->mt_blkno == 0) {
STp2639drivers/scsi/st.cif ((STp->mt_status)->mt_fileno == 0)
STp2640drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_BOT(0xffffffff);
STp2642drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_EOF(0xffffffff);
STp2644drivers/scsi/st.c(STp->mt_status)->mt_resid = STp->partition;
STp2645drivers/scsi/st.cif (STp->eof == ST_EOM_OK || STp->eof == ST_EOM_ERROR)
STp2646drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_EOT(0xffffffff);
STp2647drivers/scsi/st.celse if (STp->eof == ST_EOD)
STp2648drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_EOD(0xffffffff);
STp2649drivers/scsi/st.cif (STp->density == 1)
STp2650drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_D_800(0xffffffff);
STp2651drivers/scsi/st.celse if (STp->density == 2)
STp2652drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_D_1600(0xffffffff);
STp2653drivers/scsi/st.celse if (STp->density == 3)
STp2654drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_D_6250(0xffffffff);
STp2655drivers/scsi/st.cif (STp->ready == ST_READY)
STp2656drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_ONLINE(0xffffffff);
STp2657drivers/scsi/st.cif (STp->ready == ST_NO_TAPE)
STp2658drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_DR_OPEN(0xffffffff);
STp2660drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_SM(0xffffffff);
STp2662drivers/scsi/st.cmemcpy_tofs((char *)arg, (char *)(STp->mt_status),
STp2665drivers/scsi/st.c(STp->mt_status)->mt_erreg = 0;  /* Clear after read */
STp2682drivers/scsi/st.creturn scsi_ioctl(STp->device, cmd_in, (void *) arg);
STp2915drivers/scsi/st.cScsi_Tape * STp;
STp2952drivers/scsi/st.cSTp = &(scsi_tapes[i]);
STp2953drivers/scsi/st.cSTp->capacity = 0xfffff;
STp2954drivers/scsi/st.cSTp->mt_status = (struct mtget *) scsi_init_malloc(sizeof(struct mtget),