Lines Matching defs:blocks

215 	int in_count;		/*  | blocks remaining for next read */
216 int in_done_count; /* | count of completed in blocks */
225 int out_count; /* | blocks remaining for next write */
226 int out_done_count; /* | count of completed out blocks */
407 int normal_in_operation(Rq_coll * clp, Rq_elem * rep, int blocks);
408 void normal_out_operation(Rq_coll * clp, Rq_elem * rep, int blocks);
1929 int sg_build_scsi_cdb(unsigned char *cdbp, int cdb_sz, unsigned int blocks,
1950 cdbp[4] = (256 == blocks) ? 0 : (unsigned char)blocks;
1951 if (blocks > 256) {
1954 "blocks is 256\n");
1957 if ((start_block + blocks - 1) & (~0x1fffff)) {
1959 ME "for 6 byte commands, can't address blocks"
1978 cdbp[7] = (unsigned char)((blocks >> 8) & 0xff);
1979 cdbp[8] = (unsigned char)(blocks & 0xff);
1980 if (blocks & (~0xffff)) {
1983 "blocks is %d\n", 0xffff);
1995 cdbp[6] = (unsigned char)((blocks >> 24) & 0xff);
1996 cdbp[7] = (unsigned char)((blocks >> 16) & 0xff);
1997 cdbp[8] = (unsigned char)((blocks >> 8) & 0xff);
1998 cdbp[9] = (unsigned char)(blocks & 0xff);
2009 cdbp[10] = (unsigned char)((blocks >> 24) & 0xff);
2010 cdbp[11] = (unsigned char)((blocks >> 16) & 0xff);
2011 cdbp[12] = (unsigned char)((blocks >> 8) & 0xff);
2012 cdbp[13] = (unsigned char)(blocks & 0xff);
2025 int sg_read(int sg_fd, unsigned char *buff, int blocks, int from_block,
2032 if (sg_build_scsi_cdb(rdCmd, cdbsz, blocks, from_block, 0, fua, 0)) {
2034 ME "bad rd cdb build, from_block=%d, blocks=%d\n",
2035 from_block, blocks);
2044 io_hdr.dxfer_len = bs * blocks;
2065 from_block, blocks);
2072 memset(buff, 0, bs * blocks);
2075 bs * blocks);
2092 int sg_write(int sg_fd, unsigned char *buff, int blocks, int to_block,
2099 if (sg_build_scsi_cdb(wrCmd, cdbsz, blocks, to_block, 1, fua, 0)) {
2100 fprintf(stderr, ME "bad wr cdb build, to_block=%d, blocks=%d\n",
2101 to_block, blocks);
2110 io_hdr.dxfer_len = bs * blocks;
2131 to_block, blocks);
2139 "%d bytes\n", to_block, bs * blocks);
2209 int infd, outfd, blocks;
2482 blocks = (dd_count > blocks_per) ? blocks_per : dd_count;
2488 sg_read(infd, wrkPos, blocks, skip, bs, scsi_cdbsz,
2497 blocks = blocks_per;
2499 "Reducing read to %d blocks per loop\n",
2502 sg_read(infd, wrkPos, blocks, skip, bs,
2508 sg_read(infd, wrkPos, blocks, skip, bs,
2516 in_full += blocks;
2521 while (((res = read(infd, wrkPos, blocks * bs)) < 0) &&
2528 } else if (res < blocks * bs) {
2530 blocks = res / bs;
2532 blocks++;
2536 in_full += blocks;
2544 sg_write(outfd, wrkPos, blocks, seek, bs,
2553 blocks = blocks_per;
2555 "Reducing write to %d blocks per loop\n",
2556 blocks);
2558 sg_write(outfd, wrkPos, blocks, seek, bs,
2564 sg_write(outfd, wrkPos, blocks, seek, bs,
2571 out_full += blocks;
2576 out_full += blocks; /* act as if written out without error */
2578 while (((res = write(outfd, wrkPos, blocks * bs)) < 0)
2585 } else if (res < blocks * bs) {
2589 blocks = res / bs;
2590 out_full += blocks;
2595 out_full += blocks;
2598 dd_count -= blocks;
2599 skip += blocks;
2600 seek += blocks;
4186 (" Last block address=%u (0x%x), Number of blocks=%u\n",
4554 0, 0, /* No of blocks */
5355 return "logical blocks";
5360 return "physical blocks [Cyl:Head:Sect]\n"
6138 int sg_read2(int sg_fd, unsigned char *buff, int blocks, int from_block,
6146 if (sg_build_scsi_cdb(rdCmd, cdbsz, blocks, from_block, 0, fua, 0)) {
6148 ME "bad rd cdb build, from_block=%d, blocks=%d\n",
6149 from_block, blocks);
6157 io_hdr.dxfer_len = bs * blocks;
6188 from_block, blocks);
6205 int sg_write2(int sg_fd, unsigned char *buff, int blocks, int to_block,
6213 if (sg_build_scsi_cdb(wrCmd, cdbsz, blocks, to_block, 1, fua, 0)) {
6214 fprintf(stderr, ME "bad wr cdb build, to_block=%d, blocks=%d\n",
6215 to_block, blocks);
6224 io_hdr.dxfer_len = bs * blocks;
6257 to_block, blocks);
6282 int infd, outfd, blocks;
6593 blocks = (dd_count > blocks_per) ? blocks_per : dd_count;
6598 sg_read2(infd, wrkPos, blocks, skip, bs, scsi_cdbsz,
6604 sg_read2(infd, wrkPos, blocks, skip, bs,
6612 in_full += blocks;
6614 while (((res = read(infd, wrkPos, blocks * bs)) < 0) &&
6621 } else if (res < blocks * bs) {
6623 blocks = res / bs;
6625 blocks++;
6629 in_full += blocks;
6638 sg_write2(outfd, wrkPos, blocks, seek, bs,
6644 sg_write2(outfd, wrkPos, blocks, seek, bs,
6652 out_full += blocks;
6657 out_full += blocks; /* act as if written out without error */
6659 while (((res = write(outfd, wrkPos, blocks * bs)) < 0)
6666 } else if (res < blocks * bs) {
6670 blocks = res / bs;
6671 out_full += blocks;
6676 out_full += blocks;
6679 dd_count -= blocks;
6680 skip += blocks;
6681 seek += blocks;
6807 int blocks, status;
6838 blocks = (clp->in_count > clp->bpt) ? clp->bpt : clp->in_count;
6841 rep->num_blks = blocks;
6842 clp->in_blk += blocks;
6843 clp->in_count -= blocks;
6850 normal_in_operation(clp, rep, blocks);
6886 /* rep->num_blks = blocks; */
6887 clp->out_blk += blocks;
6888 clp->out_count -= blocks;
6895 clp->out_done_count -= blocks;
6900 normal_out_operation(clp, rep, blocks);
6925 int normal_in_operation(Rq_coll * clp, Rq_elem * rep, int blocks)
6932 blocks * clp->bs)) < 0) && (EINTR == errno)) ;
6949 if (res < blocks * clp->bs) {
6950 int o_blocks = blocks;
6952 blocks = res / clp->bs;
6954 blocks++;
6957 /* Reverse out + re-apply blocks on clp */
6960 rep->num_blks = blocks;
6961 clp->in_blk += blocks;
6962 clp->in_count -= blocks;
6964 clp->in_done_count -= blocks;
6968 void normal_out_operation(Rq_coll * clp, Rq_elem * rep, int blocks)
6990 if (res < blocks * clp->bs) {
6991 blocks = res / clp->bs;
6993 blocks++;
6996 rep->num_blks = blocks;
6998 clp->out_done_count -= blocks;
7145 fprintf(stderr, ME "bad cdb build, start_blk=%d, blocks=%d\n",
7621 ">>>> Some error occurred, remaining blocks=%d\n",