Lines Matching refs:rcoll
7303 Rq_coll rcoll; in do_scsi_sgp_read_write() local
7307 memset(&rcoll, 0, sizeof(Rq_coll)); in do_scsi_sgp_read_write()
7308 rcoll.bpt = DEF_BLOCKS_PER_TRANSFER; in do_scsi_sgp_read_write()
7309 rcoll.in_type = FT_OTHER; in do_scsi_sgp_read_write()
7310 rcoll.out_type = FT_OTHER; in do_scsi_sgp_read_write()
7311 rcoll.cdbsz = DEF_SCSI_CDBSZ; in do_scsi_sgp_read_write()
7316 if (rcoll.bs <= 0) { in do_scsi_sgp_read_write()
7317 rcoll.bs = DEF_BLOCK_SIZE; in do_scsi_sgp_read_write()
7320 rcoll.bs); in do_scsi_sgp_read_write()
7323 if (rcoll.debug) in do_scsi_sgp_read_write()
7327 rcoll.infd = STDIN_FILENO; in do_scsi_sgp_read_write()
7328 rcoll.outfd = STDOUT_FILENO; in do_scsi_sgp_read_write()
7330 rcoll.in_type = dd_filetype(inf); in do_scsi_sgp_read_write()
7332 if (FT_ST == rcoll.in_type) { in do_scsi_sgp_read_write()
7336 } else if (FT_SG == rcoll.in_type) { in do_scsi_sgp_read_write()
7337 if ((rcoll.infd = open(inf, O_RDWR)) < 0) { in do_scsi_sgp_read_write()
7344 if (sg_prepare(rcoll.infd, rcoll.bs, rcoll.bpt, in do_scsi_sgp_read_write()
7345 &rcoll.in_scsi_type)) in do_scsi_sgp_read_write()
7348 if ((rcoll.infd = open(inf, O_RDONLY)) < 0) { in do_scsi_sgp_read_write()
7357 offset *= rcoll.bs; /* could exceed 32 here! */ in do_scsi_sgp_read_write()
7358 if (llse_llseek(rcoll.infd, offset, SEEK_SET) < in do_scsi_sgp_read_write()
7371 rcoll.out_type = dd_filetype(outf); in do_scsi_sgp_read_write()
7373 if (FT_ST == rcoll.out_type) { in do_scsi_sgp_read_write()
7377 } else if (FT_SG == rcoll.out_type) { in do_scsi_sgp_read_write()
7378 if ((rcoll.outfd = open(outf, O_RDWR)) < 0) { in do_scsi_sgp_read_write()
7386 if (sg_prepare(rcoll.outfd, rcoll.bs, rcoll.bpt, in do_scsi_sgp_read_write()
7387 &rcoll.out_scsi_type)) in do_scsi_sgp_read_write()
7389 } else if (FT_DEV_NULL == rcoll.out_type) in do_scsi_sgp_read_write()
7390 rcoll.outfd = -1; /* don't bother opening */ in do_scsi_sgp_read_write()
7392 if (FT_RAW != rcoll.out_type) { in do_scsi_sgp_read_write()
7393 if ((rcoll.outfd = in do_scsi_sgp_read_write()
7404 if ((rcoll.outfd = open(outf, O_WRONLY)) < 0) { in do_scsi_sgp_read_write()
7416 offset *= rcoll.bs; /* could exceed 32 bits here! */ in do_scsi_sgp_read_write()
7417 if (llse_llseek(rcoll.outfd, offset, SEEK_SET) < in do_scsi_sgp_read_write()
7429 if ((STDIN_FILENO == rcoll.infd) && (STDOUT_FILENO == rcoll.outfd)) { in do_scsi_sgp_read_write()
7435 if (FT_SG == rcoll.in_type) { in do_scsi_sgp_read_write()
7437 read_capacity(rcoll.infd, &in_num_sect, in do_scsi_sgp_read_write()
7443 read_capacity(rcoll.infd, &in_num_sect, in do_scsi_sgp_read_write()
7455 if (FT_SG == rcoll.out_type) { in do_scsi_sgp_read_write()
7457 read_capacity(rcoll.outfd, &out_num_sect, in do_scsi_sgp_read_write()
7463 read_capacity(rcoll.outfd, &out_num_sect, in do_scsi_sgp_read_write()
7486 if (rcoll.debug > 1) in do_scsi_sgp_read_write()
7494 rcoll.in_count = count; in do_scsi_sgp_read_write()
7495 rcoll.in_done_count = count; in do_scsi_sgp_read_write()
7496 rcoll.skip = skip; in do_scsi_sgp_read_write()
7497 rcoll.in_blk = skip; in do_scsi_sgp_read_write()
7498 rcoll.out_count = count; in do_scsi_sgp_read_write()
7499 rcoll.out_done_count = count; in do_scsi_sgp_read_write()
7500 rcoll.seek = seek; in do_scsi_sgp_read_write()
7501 rcoll.out_blk = seek; in do_scsi_sgp_read_write()
7502 status = pthread_mutex_init(&rcoll.in_mutex, NULL); in do_scsi_sgp_read_write()
7505 status = pthread_mutex_init(&rcoll.out_mutex, NULL); in do_scsi_sgp_read_write()
7508 status = pthread_mutex_init(&rcoll.aux_mutex, NULL); in do_scsi_sgp_read_write()
7511 status = pthread_cond_init(&rcoll.out_sync_cv, NULL); in do_scsi_sgp_read_write()
7521 sig_listen_thread, (void *)&rcoll); in do_scsi_sgp_read_write()
7532 if ((rcoll.out_done_count > 0) && (num_threads > 0)) { in do_scsi_sgp_read_write()
7534 status = pthread_mutex_lock(&rcoll.out_mutex); in do_scsi_sgp_read_write()
7538 (void *)&rcoll); in do_scsi_sgp_read_write()
7541 if (rcoll.debug) in do_scsi_sgp_read_write()
7545 pthread_cleanup_push(cleanup_out, (void *)&rcoll); in do_scsi_sgp_read_write()
7547 pthread_cond_wait(&rcoll.out_sync_cv, &rcoll.out_mutex); in do_scsi_sgp_read_write()
7551 status = pthread_mutex_unlock(&rcoll.out_mutex); in do_scsi_sgp_read_write()
7559 (void *)&rcoll); in do_scsi_sgp_read_write()
7562 if (rcoll.debug) in do_scsi_sgp_read_write()
7572 if (rcoll.debug) in do_scsi_sgp_read_write()
7591 b = (double)rcoll.bs * (count - rcoll.out_done_count); in do_scsi_sgp_read_write()
7600 if (FT_SG == rcoll.out_type) { in do_scsi_sgp_read_write()
7602 res = sync_cache(rcoll.outfd); in do_scsi_sgp_read_write()
7606 res = sync_cache(rcoll.outfd); in do_scsi_sgp_read_write()
7617 if (STDIN_FILENO != rcoll.infd) in do_scsi_sgp_read_write()
7618 close(rcoll.infd); in do_scsi_sgp_read_write()
7619 if ((STDOUT_FILENO != rcoll.outfd) && (FT_DEV_NULL != rcoll.out_type)) in do_scsi_sgp_read_write()
7620 close(rcoll.outfd); in do_scsi_sgp_read_write()
7622 if (0 != rcoll.out_count) { in do_scsi_sgp_read_write()
7625 rcoll.out_count); in do_scsi_sgp_read_write()
7628 infull = count - rcoll.in_done_count - rcoll.in_partial; in do_scsi_sgp_read_write()
7629 fprintf(stderr, "%d+%d records in\n", infull, rcoll.in_partial); in do_scsi_sgp_read_write()
7630 outfull = count - rcoll.out_done_count - rcoll.out_partial; in do_scsi_sgp_read_write()
7631 fprintf(stderr, "%d+%d records out\n", outfull, rcoll.out_partial); in do_scsi_sgp_read_write()
7632 if (rcoll.dio_incomplete) { in do_scsi_sgp_read_write()
7638 rcoll.dio_incomplete); in do_scsi_sgp_read_write()
7650 if (rcoll.sum_of_resids) in do_scsi_sgp_read_write()
7652 rcoll.sum_of_resids); in do_scsi_sgp_read_write()