Lines Matching refs:STbuffer
666 struct st_buffer *STbuffer; in write_behind_check() local
671 STbuffer = STp->buffer; in write_behind_check()
672 if (!STbuffer->writing) in write_behind_check()
683 SRpnt = STbuffer->last_SRpnt; in write_behind_check()
684 STbuffer->last_SRpnt = NULL; in write_behind_check()
690 STbuffer->buffer_bytes -= STbuffer->writing; in write_behind_check()
696 STps->drv_block += STbuffer->writing / STp->block_size; in write_behind_check()
699 cmdstatp = &STbuffer->cmdstat; in write_behind_check()
700 if (STbuffer->syscall_result) { in write_behind_check()
714 STbuffer->writing = 0; in write_behind_check()
719 STbuffer->cmdstat.midlevel_result, retval);) /* end DEB */ in write_behind_check()
3906 static int enlarge_buffer(struct st_buffer * STbuffer, int new_size, int need_dma) in enlarge_buffer() argument
3911 if (new_size <= STbuffer->buffer_size) in enlarge_buffer()
3914 if (STbuffer->buffer_size <= PAGE_SIZE) in enlarge_buffer()
3915 normalize_buffer(STbuffer); /* Avoid extra segment */ in enlarge_buffer()
3917 max_segs = STbuffer->use_sg; in enlarge_buffer()
3923 if (STbuffer->cleared) in enlarge_buffer()
3926 if (STbuffer->frp_segs) { in enlarge_buffer()
3927 order = STbuffer->reserved_page_order; in enlarge_buffer()
3935 STbuffer->reserved_page_order = order; in enlarge_buffer()
3940 normalize_buffer(STbuffer); in enlarge_buffer()
3941 return enlarge_buffer(STbuffer, new_size, need_dma); in enlarge_buffer()
3944 for (segs = STbuffer->frp_segs, got = STbuffer->buffer_size; in enlarge_buffer()
3950 DEB(STbuffer->buffer_size = got); in enlarge_buffer()
3951 normalize_buffer(STbuffer); in enlarge_buffer()
3955 STbuffer->frp_segs += 1; in enlarge_buffer()
3957 STbuffer->buffer_size = got; in enlarge_buffer()
3958 STbuffer->reserved_pages[segs] = page; in enlarge_buffer()
3961 STbuffer->b_data = page_address(STbuffer->reserved_pages[0]); in enlarge_buffer()
3980 static void normalize_buffer(struct st_buffer * STbuffer) in normalize_buffer() argument
3982 int i, order = STbuffer->reserved_page_order; in normalize_buffer()
3984 for (i = 0; i < STbuffer->frp_segs; i++) { in normalize_buffer()
3985 __free_pages(STbuffer->reserved_pages[i], order); in normalize_buffer()
3986 STbuffer->buffer_size -= (PAGE_SIZE << order); in normalize_buffer()
3988 STbuffer->frp_segs = 0; in normalize_buffer()
3989 STbuffer->sg_segs = 0; in normalize_buffer()
3990 STbuffer->reserved_page_order = 0; in normalize_buffer()
3991 STbuffer->map_data.offset = 0; in normalize_buffer()