Lines Matching refs:STm
887 static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm)
893 STm->default_density >= 0 &&
894 STm->default_density != STp->density) {
895 arg = STm->default_density;
901 STm->default_blksize >= 0 &&
902 STm->default_blksize != STp->block_size) {
903 arg |= STm->default_blksize;
912 STm->default_blksize, STm->default_density);
1051 struct st_modedef *STm;
1064 STm = &(STp->modes[STp->current_mode]);
1230 if (!(STm->defaults_for_writes) &&
1231 (retval = set_mode_densblk(STp, STm)) < 0)
1354 struct st_modedef *STm = &(STp->modes[STp->current_mode]);
1429 if (!STm->sysv || STps->rw != ST_READING) {
1638 struct st_modedef *STm;
1657 STm = &(STp->modes[STp->current_mode]);
1673 if ((retval = set_mode_densblk(STp, STm)) < 0)
1675 if (STm->default_compression != ST_DONT_TOUCH &&
1677 if (st_compression(STp, (STm->default_compression == ST_YES))) {
1755 STm->do_async_writes && STps->eof < ST_EOM_OK;
1757 if (STp->block_size != 0 && STm->do_buffer_writes &&
1913 struct st_modedef *STm;
1921 STm = &(STp->modes[STp->current_mode]);
1930 if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) {
2112 struct st_modedef *STm;
2123 STm = &(STp->modes[STp->current_mode]);
2125 if (!STm->do_read_ahead) {
2254 static void st_log_options(struct scsi_tape * STp, struct st_modedef * STm)
2260 STp->current_mode, STm->do_buffer_writes,
2261 STm->do_async_writes, STm->do_read_ahead);
2270 STm->defaults_for_writes, STp->omit_blklims,
2275 STm->sysv, STp->immediate, STp->sili,
2287 struct st_modedef *STm;
2291 STm = &(STp->modes[STp->current_mode]);
2292 if (!STm->defined) {
2293 cd0 = STm->cdevs[0];
2294 cd1 = STm->cdevs[1];
2295 d0 = STm->devs[0];
2296 d1 = STm->devs[1];
2297 memcpy(STm, &(STp->modes[0]), sizeof(struct st_modedef));
2298 STm->cdevs[0] = cd0;
2299 STm->cdevs[1] = cd1;
2300 STm->devs[0] = d0;
2301 STm->devs[1] = d1;
2309 STm->do_buffer_writes = (options & MT_ST_BUFFER_WRITES) != 0;
2310 STm->do_async_writes = (options & MT_ST_ASYNC_WRITES) != 0;
2311 STm->defaults_for_writes = (options & MT_ST_DEF_WRITES) != 0;
2312 STm->do_read_ahead = (options & MT_ST_READ_AHEAD) != 0;
2323 STm->sysv = (options & MT_ST_SYSV) != 0;
2326 st_log_options(STp, STm); )
2330 STm->do_buffer_writes = value;
2332 STm->do_async_writes = value;
2334 STm->defaults_for_writes = value;
2336 STm->do_read_ahead = value;
2357 STm->sysv = value;
2363 st_log_options(STp, STm); )
2369 STm->default_blksize = (-1);
2372 STm->default_blksize = value;
2374 "%d bytes.\n", STm->default_blksize);
2377 set_mode_densblk(STp, STm);
2409 STm->default_density = (-1);
2413 STm->default_density = value & 0xff;
2415 STm->default_density);
2418 set_mode_densblk(STp, STm);
2436 STm->default_compression = ST_DONT_TOUCH;
2447 STm->default_compression = (value & 1 ? ST_YES : ST_NO);
2453 st_compression(STp, (STm->default_compression == ST_YES));
3523 struct st_modedef *STm;
3536 STm = &(STp->modes[STp->current_mode]);
3573 if (!STm->defined &&
3743 if (!STm->defined) {
3809 if (STm->do_async_writes ||
3810 (STm->do_buffer_writes && STp->block_size != 0) ||
4212 struct st_modedef *STm = &(tape->modes[mode]);
4226 STm->cdevs[rew] = cdev;
4248 STm->devs[rew] = dev;
4252 cdev_del(STm->cdevs[rew]);
4254 STm->cdevs[rew] = NULL;
4255 STm->devs[rew] = NULL;
4280 struct st_modedef *STm = &(tape->modes[mode]);
4282 if (STm->cdevs[rew])
4283 cdev_del(STm->cdevs[rew]);
4284 if (STm->devs[rew])
4285 device_unregister(STm->devs[rew]);
4295 struct st_modedef *STm;
4380 STm = &(tpnt->modes[i]);
4381 STm->defined = 0;
4382 STm->sysv = ST_SYSV;
4383 STm->defaults_for_writes = 0;
4384 STm->do_async_writes = ST_ASYNC_WRITES;
4385 STm->do_buffer_writes = ST_BUFFER_WRITES;
4386 STm->do_read_ahead = ST_READ_AHEAD;
4387 STm->default_compression = ST_DONT_TOUCH;
4388 STm->default_blksize = (-1); /* No forced size */
4389 STm->default_density = (-1); /* No forced density */
4390 STm->tape = tpnt;
4640 struct st_modedef *STm = dev_get_drvdata(dev);
4643 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined);
4652 struct st_modedef *STm = dev_get_drvdata(dev);
4655 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize);
4664 struct st_modedef *STm = dev_get_drvdata(dev);
4668 fmt = STm->default_density >= 0 ? "0x%02x\n" : "%d\n";
4669 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density);
4678 struct st_modedef *STm = dev_get_drvdata(dev);
4681 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1);
4689 struct st_modedef *STm = dev_get_drvdata(dev);
4690 struct scsi_tape *STp = STm->tape;
4694 options = STm->do_buffer_writes ? MT_ST_BUFFER_WRITES : 0;
4695 options |= STm->do_async_writes ? MT_ST_ASYNC_WRITES : 0;
4696 options |= STm->do_read_ahead ? MT_ST_READ_AHEAD : 0;
4700 options |= STm->defaults_for_writes ? MT_ST_DEF_WRITES : 0;
4705 options |= STm->sysv ? MT_ST_SYSV : 0;
4726 struct st_modedef *STm = dev_get_drvdata(dev);
4729 (long long)atomic64_read(&STm->tape->stats->read_cnt));
4744 struct st_modedef *STm = dev_get_drvdata(dev);
4747 (long long)atomic64_read(&STm->tape->stats->read_byte_cnt));
4760 struct st_modedef *STm = dev_get_drvdata(dev);
4763 (long long)atomic64_read(&STm->tape->stats->tot_read_time));
4777 struct st_modedef *STm = dev_get_drvdata(dev);
4780 (long long)atomic64_read(&STm->tape->stats->write_cnt));
4794 struct st_modedef *STm = dev_get_drvdata(dev);
4797 (long long)atomic64_read(&STm->tape->stats->write_byte_cnt));
4811 struct st_modedef *STm = dev_get_drvdata(dev);
4814 (long long)atomic64_read(&STm->tape->stats->tot_write_time));
4829 struct st_modedef *STm = dev_get_drvdata(dev);
4832 (long long)atomic64_read(&STm->tape->stats->in_flight));
4849 struct st_modedef *STm = dev_get_drvdata(dev);
4852 (long long)atomic64_read(&STm->tape->stats->tot_io_time));
4868 struct st_modedef *STm = dev_get_drvdata(dev);
4871 (long long)atomic64_read(&STm->tape->stats->other_cnt));
4886 struct st_modedef *STm = dev_get_drvdata(dev);
4889 (long long)atomic64_read(&STm->tape->stats->resid_cnt));