Lines Matching refs:do_count
3142 ssize_t i, do_count, blks, transfer; in osst_write() local
3354 do_count = (STp->buffer)->buffer_blocks * STp->block_size - in osst_write()
3356 if (do_count > count) in osst_write()
3357 do_count = count; in osst_write()
3359 i = append_to_buffer(b_point, STp->buffer, do_count); in osst_write()
3365 blks = do_count / STp->block_size; in osst_write()
3372 if (transfer <= do_count) { in osst_write()
3373 pos += do_count - transfer; in osst_write()
3374 count -= do_count - transfer; in osst_write()
3376 STps->drv_block += (do_count - transfer) / STp->block_size; in osst_write()
3411 pos += do_count; in osst_write()
3412 b_point += do_count; in osst_write()
3413 count -= do_count; in osst_write()
5308 static int append_to_buffer(const char *ubp, OSST_buffer *st_bp, int do_count) in append_to_buffer() argument
5319 for ( ; i < st_bp->sg_segs && do_count > 0; i++) { in append_to_buffer()
5320 cnt = st_bp->sg[i].length - offset < do_count ? in append_to_buffer()
5321 st_bp->sg[i].length - offset : do_count; in append_to_buffer()
5325 do_count -= cnt; in append_to_buffer()
5330 if (do_count) { /* Should never happen */ in append_to_buffer()
5332 do_count); in append_to_buffer()
5341 static int from_buffer(OSST_buffer *st_bp, char *ubp, int do_count) in from_buffer() argument
5352 for ( ; i < st_bp->sg_segs && do_count > 0; i++) { in from_buffer()
5353 cnt = st_bp->sg[i].length - offset < do_count ? in from_buffer()
5354 st_bp->sg[i].length - offset : do_count; in from_buffer()
5358 do_count -= cnt; in from_buffer()
5364 if (do_count) { /* Should never happen */ in from_buffer()
5365 printk(KERN_WARNING "osst :A: From_buffer overflow (left %d).\n", do_count); in from_buffer()
5375 int i, offset, do_count, cnt; in osst_zero_buffer_tail() local
5384 for (do_count = OS_DATA_SIZE - st_bp->buffer_bytes; in osst_zero_buffer_tail()
5385 i < st_bp->sg_segs && do_count > 0; i++) { in osst_zero_buffer_tail()
5386 cnt = st_bp->sg[i].length - offset < do_count ? in osst_zero_buffer_tail()
5387 st_bp->sg[i].length - offset : do_count ; in osst_zero_buffer_tail()
5389 do_count -= cnt; in osst_zero_buffer_tail()
5392 if (do_count) { /* Should never happen */ in osst_zero_buffer_tail()
5393 printk(KERN_WARNING "osst :A: Zero_buffer overflow (left %d).\n", do_count); in osst_zero_buffer_tail()
5403 int i, cnt, do_count = OS_DATA_SIZE; in osst_copy_to_buffer() local
5405 for (i = 0; i < st_bp->sg_segs && do_count > 0; i++) { in osst_copy_to_buffer()
5406 cnt = st_bp->sg[i].length < do_count ? in osst_copy_to_buffer()
5407 st_bp->sg[i].length : do_count ; in osst_copy_to_buffer()
5409 do_count -= cnt; in osst_copy_to_buffer()
5412 if (do_count || i != st_bp->sg_segs-1) { /* Should never happen */ in osst_copy_to_buffer()
5414 do_count, i); in osst_copy_to_buffer()
5424 int i, cnt, do_count = OS_DATA_SIZE; in osst_copy_from_buffer() local
5426 for (i = 0; i < st_bp->sg_segs && do_count > 0; i++) { in osst_copy_from_buffer()
5427 cnt = st_bp->sg[i].length < do_count ? in osst_copy_from_buffer()
5428 st_bp->sg[i].length : do_count ; in osst_copy_from_buffer()
5430 do_count -= cnt; in osst_copy_from_buffer()
5433 if (do_count || i != st_bp->sg_segs-1) { /* Should never happen */ in osst_copy_from_buffer()
5435 do_count, i); in osst_copy_from_buffer()