Lines Matching refs:STps
665 struct st_partstat *STps; in write_behind_check() local
689 STps = &(STp->ps[STp->partition]); in write_behind_check()
690 if (STps->drv_block >= 0) { in write_behind_check()
692 STps->drv_block++; in write_behind_check()
694 STps->drv_block += STbuffer->writing / STp->block_size; in write_behind_check()
710 STps->drv_block = -1; in write_behind_check()
767 struct st_partstat *STps; in st_flush_write_buffer() local
793 STps = &(STp->ps[STp->partition]); in st_flush_write_buffer()
805 if (STps->drv_block >= 0) in st_flush_write_buffer()
806 STps->drv_block += blks; in st_flush_write_buffer()
810 STps->drv_block = (-1); in st_flush_write_buffer()
814 if (STps->drv_block >= 0) in st_flush_write_buffer()
815 STps->drv_block += blks; in st_flush_write_buffer()
831 struct st_partstat *STps; in flush_buffer() local
842 STps = &(STp->ps[STp->partition]); in flush_buffer()
843 if (STps->rw == ST_WRITING) /* Writing */ in flush_buffer()
857 if (STps->eof == ST_FM_HIT) { in flush_buffer()
860 STps->eof = ST_NOEOF; in flush_buffer()
862 if (STps->drv_file >= 0) in flush_buffer()
863 STps->drv_file++; in flush_buffer()
864 STps->drv_block = 0; in flush_buffer()
869 } else if (STps->eof == ST_FM_HIT) { in flush_buffer()
870 if (STps->drv_file >= 0) in flush_buffer()
871 STps->drv_file++; in flush_buffer()
872 STps->drv_block = 0; in flush_buffer()
873 STps->eof = ST_NOEOF; in flush_buffer()
934 struct st_partstat *STps; in reset_state() local
938 STps = &(STp->ps[i]); in reset_state()
939 STps->rw = ST_IDLE; in reset_state()
940 STps->eof = ST_NOEOF; in reset_state()
941 STps->at_sm = 0; in reset_state()
942 STps->last_block_valid = 0; in reset_state()
943 STps->drv_block = -1; in reset_state()
944 STps->drv_file = -1; in reset_state()
1044 struct st_partstat *STps; in check_tape() local
1074 STps = &(STp->ps[i]); in check_tape()
1075 STps->rw = ST_IDLE; in check_tape()
1076 STps->eof = ST_NOEOF; in check_tape()
1077 STps->at_sm = 0; in check_tape()
1078 STps->last_block_valid = 0; in check_tape()
1079 STps->drv_block = 0; in check_tape()
1080 STps->drv_file = 0; in check_tape()
1249 struct st_partstat *STps; in st_open() local
1303 STps = &(STp->ps[i]); in st_open()
1304 STps->rw = ST_IDLE; in st_open()
1345 struct st_partstat *STps = &(STp->ps[STp->partition]); in st_flush() local
1350 if (STps->rw == ST_WRITING && !STp->pos_unknown) { in st_flush()
1370 if (STps->rw == ST_WRITING && !STp->pos_unknown) { in st_flush()
1400 if (STps->drv_file >= 0) in st_flush()
1401 STps->drv_file++; in st_flush()
1402 STps->drv_block = 0; in st_flush()
1405 STps->eof = ST_FM; in st_flush()
1418 STps = &(STp->ps[STp->partition]); in st_flush()
1419 if (!STm->sysv || STps->rw != ST_READING) { in st_flush()
1422 else if (STps->eof == ST_FM_HIT) { in st_flush()
1425 if (STps->drv_file >= 0) in st_flush()
1426 STps->drv_file++; in st_flush()
1427 STps->drv_block = 0; in st_flush()
1428 STps->eof = ST_FM; in st_flush()
1430 STps->eof = ST_NOEOF; in st_flush()
1432 } else if ((STps->eof == ST_NOEOF && in st_flush()
1434 STps->eof == ST_FM_HIT) { in st_flush()
1435 if (STps->drv_file >= 0) in st_flush()
1436 STps->drv_file++; in st_flush()
1437 STps->drv_block = 0; in st_flush()
1438 STps->eof = ST_FM; in st_flush()
1630 struct st_partstat *STps; in st_write() local
1649 STps = &(STp->ps[STp->partition]); in st_write()
1657 if (STps->rw == ST_READING) { in st_write()
1661 STps->rw = ST_WRITING; in st_write()
1662 } else if (STps->rw != ST_WRITING && in st_write()
1663 STps->drv_file == 0 && STps->drv_block == 0) { in st_write()
1683 STps->eof = ST_EOM_OK; in st_write()
1685 STps->eof = ST_EOM_ERROR; in st_write()
1688 if (STps->eof == ST_EOM_OK) { in st_write()
1689 STps->eof = ST_EOD_1; /* allow next write */ in st_write()
1693 else if (STps->eof == ST_EOM_ERROR) { in st_write()
1718 STps->rw = ST_WRITING; in st_write()
1746 STm->do_async_writes && STps->eof < ST_EOM_OK; in st_write()
1749 !(STp->try_dio_now && try_wdio) && STps->eof < ST_EOM_OK && in st_write()
1810 STps->eof = ST_EOM_OK; in st_write()
1828 if (STps->drv_block >= 0) { in st_write()
1829 STps->drv_block += (transfer - undone) / in st_write()
1832 STps->eof = ST_EOM_OK; in st_write()
1844 STps->eof = ST_EOM_ERROR; in st_write()
1845 STps->drv_block = (-1); /* Too cautious? */ in st_write()
1853 STps->drv_block = (-1); /* Too cautious? */ in st_write()
1859 if (STps->drv_block >= 0) { in st_write()
1861 STps->drv_block += (do_count > 0); in st_write()
1863 STps->drv_block += blks; in st_write()
1876 if (STps->eof == ST_EOD_1) in st_write()
1877 STps->eof = ST_EOM_OK; in st_write()
1878 else if (STps->eof != ST_EOM_OK) in st_write()
1879 STps->eof = ST_NOEOF; in st_write()
1904 struct st_partstat *STps; in read_tape() local
1912 STps = &(STp->ps[STp->partition]); in read_tape()
1913 if (STps->eof == ST_FM_HIT) in read_tape()
1951 STps->at_sm = 0; in read_tape()
1991 if (STps->drv_block >= 0) in read_tape()
1992 STps->drv_block += 1; in read_tape()
2004 if (STps->drv_block >= 0) in read_tape()
2005 STps->drv_block += blks - transfer + 1; in read_tape()
2017 if (STps->drv_block >= 0) in read_tape()
2018 STps->drv_block += 1; in read_tape()
2023 if (STps->eof != ST_FM_HIT) in read_tape()
2024 STps->eof = ST_FM_HIT; in read_tape()
2026 STps->eof = ST_EOD_2; in read_tape()
2036 if (STps->eof == ST_FM) in read_tape()
2037 STps->eof = ST_EOD_1; in read_tape()
2039 STps->eof = ST_EOM_OK; in read_tape()
2054 STps->drv_block = (-1); in read_tape()
2055 if (STps->eof == ST_FM && in read_tape()
2060 STps->eof = ST_EOD_2; /* First BLANK_CHECK after FM */ in read_tape()
2081 if (STps->drv_block >= 0) { in read_tape()
2083 STps->drv_block++; in read_tape()
2085 STps->drv_block += STbp->buffer_bytes / STp->block_size; in read_tape()
2102 struct st_partstat *STps; in st_read() local
2121 STps = &(STp->ps[STp->partition]); in st_read()
2122 if (STps->rw == ST_WRITING) { in st_read()
2126 STps->rw = ST_READING; in st_read()
2129 if (debugging && STps->eof != ST_NOEOF) in st_read()
2132 STps->eof, STbp->buffer_bytes); in st_read()
2141 STps->eof >= ST_EOD_1) { in st_read()
2142 if (STps->eof < ST_EOD) { in st_read()
2143 STps->eof += 1; in st_read()
2163 STps->rw = ST_READING; in st_read()
2181 if (debugging && STps->eof != ST_NOEOF) in st_read()
2184 STps->eof, STbp->buffer_bytes, in st_read()
2208 if (STps->eof == ST_FM_HIT) { in st_read()
2209 STps->eof = ST_FM; in st_read()
2210 STps->drv_block = 0; in st_read()
2211 if (STps->drv_file >= 0) in st_read()
2212 STps->drv_file++; in st_read()
2213 } else if (STps->eof == ST_EOD_1) { in st_read()
2214 STps->eof = ST_EOD_2; in st_read()
2215 STps->drv_block = 0; in st_read()
2216 if (STps->drv_file >= 0) in st_read()
2217 STps->drv_file++; in st_read()
2218 } else if (STps->eof == ST_EOD_2) in st_read()
2219 STps->eof = ST_EOD; in st_read()
2220 } else if (STps->eof == ST_FM) in st_read()
2221 STps->eof = ST_NOEOF; in st_read()
2603 struct st_partstat *STps; in do_load_unload() local
2663 STps = &(STp->ps[STp->partition]); in do_load_unload()
2664 STps->drv_file = STps->drv_block = (-1); in do_load_unload()
2703 struct st_partstat *STps; in st_int_ioctl() local
2715 STps = &(STp->ps[STp->partition]); in st_int_ioctl()
2716 fileno = STps->drv_file; in st_int_ioctl()
2717 blkno = STps->drv_block; in st_int_ioctl()
2718 at_sm = STps->at_sm; in st_int_ioctl()
2860 fileno = STps->drv_file; in st_int_ioctl()
2861 if (STps->eof >= ST_EOD_1) in st_int_ioctl()
2966 STps->drv_block = blkno; in st_int_ioctl()
2967 STps->drv_file = fileno; in st_int_ioctl()
2968 STps->at_sm = at_sm; in st_int_ioctl()
2990 STps->eof = ST_EOD; in st_int_ioctl()
2992 STps->eof = ST_FM; in st_int_ioctl()
2994 STps->eof = ST_NOEOF; in st_int_ioctl()
2997 STps->rw = ST_IDLE; /* prevent automatic WEOF at close */ in st_int_ioctl()
3005 STps->eof = ST_EOM_OK; in st_int_ioctl()
3006 STps->drv_block = 0; in st_int_ioctl()
3020 STps->eof = ST_NOEOF; in st_int_ioctl()
3025 STps->eof = ST_NOEOF; in st_int_ioctl()
3027 STps->drv_file = fileno; in st_int_ioctl()
3030 STps->drv_file = fileno - undone; in st_int_ioctl()
3032 STps->drv_file = fileno; in st_int_ioctl()
3033 STps->drv_block = -1; in st_int_ioctl()
3034 STps->eof = ST_NOEOF; in st_int_ioctl()
3038 if (STps->drv_file >= 0) in st_int_ioctl()
3039 STps->drv_file = fileno + undone; in st_int_ioctl()
3040 STps->drv_block = 0; in st_int_ioctl()
3041 STps->eof = ST_NOEOF; in st_int_ioctl()
3044 if (STps->drv_file >= 0) in st_int_ioctl()
3045 STps->drv_file++; in st_int_ioctl()
3046 STps->drv_block = 0; in st_int_ioctl()
3047 STps->eof = ST_FM; in st_int_ioctl()
3050 STps->drv_block = blkno - undone; in st_int_ioctl()
3052 STps->drv_block = (-1); in st_int_ioctl()
3053 STps->eof = ST_NOEOF; in st_int_ioctl()
3057 STps->drv_file--; in st_int_ioctl()
3058 STps->drv_block = (-1); in st_int_ioctl()
3062 if (STps->drv_block >= 0) in st_int_ioctl()
3063 STps->drv_block = blkno + undone; in st_int_ioctl()
3065 STps->eof = ST_NOEOF; in st_int_ioctl()
3067 STps->drv_file = (-1); in st_int_ioctl()
3068 STps->drv_block = (-1); in st_int_ioctl()
3069 STps->eof = ST_EOD; in st_int_ioctl()
3084 STps->eof = ST_NOEOF; in st_int_ioctl()
3087 STps->eof = ST_EOD; in st_int_ioctl()
3163 struct st_partstat *STps; in set_location() local
3173 STps = &(STp->ps[STp->partition]); in set_location()
3186 STps->last_block_valid = 0; in set_location()
3188 STps->last_block_valid = 1; in set_location()
3189 STps->last_block_visited = blk; in set_location()
3229 STps->drv_block = STps->drv_file = (-1); in set_location()
3230 STps->eof = ST_NOEOF; in set_location()
3240 STps = &(STp->ps[partition]); in set_location()
3241 if (!STps->last_block_valid || in set_location()
3242 STps->last_block_visited != block) { in set_location()
3243 STps->at_sm = 0; in set_location()
3244 STps->rw = ST_IDLE; in set_location()
3247 STps->at_sm = 0; in set_location()
3249 STps->drv_block = STps->drv_file = 0; in set_location()
3278 struct st_partstat *STps; in switch_partition() local
3282 STps = &(STp->ps[STp->new_partition]); in switch_partition()
3283 if (!STps->last_block_valid) in switch_partition()
3284 STps->last_block_visited = 0; in switch_partition()
3285 return set_location(STp, STps->last_block_visited, STp->new_partition, 1); in switch_partition()
3506 struct st_partstat *STps; in st_ioctl() local
3520 STps = &(STp->ps[STp->partition]); in st_ioctl()
3565 if (STps->eof == ST_FM_HIT) { in st_ioctl()
3569 if (STps->drv_file >= 0) in st_ioctl()
3570 STps->drv_file += 1; in st_ioctl()
3573 if (STps->drv_file >= 0) in st_ioctl()
3574 STps->drv_file += 1; in st_ioctl()
3596 if (STps->rw == ST_WRITING && in st_ioctl()
3607 STps->rw = ST_IDLE; in st_ioctl()
3633 STps->rw = ST_IDLE; /* Prevent automatic WEOF and fsf */ in st_ioctl()
3686 STps->drv_block = STps->drv_file = 0; in st_ioctl()
3753 mt_status.mt_blkno = STps->drv_block; in st_ioctl()
3754 mt_status.mt_fileno = STps->drv_file; in st_ioctl()
3756 if (STps->rw == ST_WRITING) in st_ioctl()
3759 else if (STps->rw == ST_READING) in st_ioctl()
3776 if (STps->eof == ST_EOM_OK || STps->eof == ST_EOM_ERROR) in st_ioctl()
3778 else if (STps->eof >= ST_EOM_OK) in st_ioctl()
3790 if (STps->at_sm) in st_ioctl()
4257 struct st_partstat *STps; in st_probe() local
4354 STps = &(tpnt->ps[i]); in st_probe()
4355 STps->rw = ST_IDLE; in st_probe()
4356 STps->eof = ST_NOEOF; in st_probe()
4357 STps->at_sm = 0; in st_probe()
4358 STps->last_block_valid = 0; in st_probe()
4359 STps->drv_block = (-1); in st_probe()
4360 STps->drv_file = (-1); in st_probe()