Lines Matching refs:STbuffer
413 ST_buffer *STbuffer; in write_behind_check() local
416 STbuffer = STp->buffer; in write_behind_check()
431 STbuffer->buffer_bytes -= STbuffer->writing; in write_behind_check()
437 STps->drv_block += STbuffer->writing / STp->block_size; in write_behind_check()
439 STbuffer->writing = 0; in write_behind_check()
559 ST_buffer *STbuffer; in flush_buffer() local
562 STbuffer = STp->buffer; in flush_buffer()
3515 static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma) in enlarge_buffer() argument
3519 normalize_buffer(STbuffer); in enlarge_buffer()
3521 max_segs = STbuffer->use_sg; in enlarge_buffer()
3524 nbr = max_segs - STbuffer->sg_segs; in enlarge_buffer()
3532 b_size * nbr < new_size - STbuffer->buffer_size; in enlarge_buffer()
3536 for (segs = STbuffer->sg_segs, got = STbuffer->buffer_size; in enlarge_buffer()
3538 STbuffer->sg[segs].address = in enlarge_buffer()
3540 if (STbuffer->sg[segs].address == NULL) { in enlarge_buffer()
3548 DEB(STbuffer->buffer_size = got); in enlarge_buffer()
3549 normalize_buffer(STbuffer); in enlarge_buffer()
3552 STbuffer->sg[segs].page = NULL; in enlarge_buffer()
3553 STbuffer->sg_lengths[segs] = b_size; in enlarge_buffer()
3554 STbuffer->sg_segs += 1; in enlarge_buffer()
3556 STbuffer->buffer_size = got; in enlarge_buffer()
3561 got, STbuffer->orig_sg_segs, STbuffer->sg_segs, b_size)); in enlarge_buffer()
3568 static void normalize_buffer(ST_buffer * STbuffer) in normalize_buffer() argument
3572 for (i = STbuffer->orig_sg_segs; i < STbuffer->sg_segs; i++) { in normalize_buffer()
3573 for (b_size=PAGE_SIZE, order=0; b_size < STbuffer->sg_lengths[i]; in normalize_buffer()
3576 free_pages((unsigned long)(STbuffer->sg[i].address), order); in normalize_buffer()
3577 STbuffer->buffer_size -= STbuffer->sg_lengths[i]; in normalize_buffer()
3580 if (debugging && STbuffer->orig_sg_segs < STbuffer->sg_segs) in normalize_buffer()
3582 STbuffer->sg[0].address, STbuffer->buffer_size, in normalize_buffer()
3583 STbuffer->sg_segs); in normalize_buffer()
3585 STbuffer->sg_segs = STbuffer->orig_sg_segs; in normalize_buffer()