Lines Matching defs:STbp
1475 struct st_buffer *STbp = STp->buffer;
1484 i = sgl_map_user_pages(STbp, STbp->use_sg, (unsigned long)buf,
1487 STbp->do_dio = i;
1488 STbp->buffer_bytes = 0; /* can be used as transfer counter */
1491 STbp->do_dio = 0; /* fall back to buffering with any error */
1492 STbp->sg_segs = STbp->do_dio;
1494 if (STbp->do_dio) {
1496 STp->nbr_pages += STbp->do_dio;
1500 STbp->do_dio = 0;
1503 if (!STbp->do_dio) {
1511 if (is_read && STp->sili && !STbp->cleared)
1512 clear_buffer(STbp);
1515 if (bufsize > STbp->buffer_size &&
1516 !enlarge_buffer(STbp, bufsize, STp->restr_dma)) {
1523 STbp->buffer_blocks = bufsize / STp->block_size;
1534 struct st_buffer *STbp;
1536 STbp = STp->buffer;
1537 if (STbp->do_dio) {
1538 sgl_unmap_user_pages(STbp, STbp->do_dio, is_read);
1539 STbp->do_dio = 0;
1540 STbp->sg_segs = 0;
1560 struct st_buffer *STbp;
1609 STbp = STp->buffer;
1631 !STbp->do_dio &&
1653 if (STbp->do_dio) {
1660 do_count = STbp->buffer_blocks * STp->block_size -
1661 STbp->buffer_bytes;
1666 i = append_to_buffer(b_point, STbp, do_count);
1675 async_write = STp->block_size == 0 && !STbp->do_dio &&
1680 STbp->buffer_bytes < STbp->buffer_size) {
1691 if (!STbp->do_dio)
1692 blks = STbp->buffer_bytes;
1706 retval = STbp->syscall_result;
1709 if (async_write && !STbp->syscall_result) {
1710 STbp->writing = transfer;
1711 STp->dirty = !(STbp->writing ==
1712 STbp->buffer_bytes);
1718 if (STbp->syscall_result != 0) {
1784 retval = STbp->syscall_result;
1796 STbp->buffer_bytes = 0;
1836 struct st_buffer *STbp;
1847 STbp = STp->buffer;
1857 if (!STbp->do_dio && bytes > (STp->buffer)->buffer_size)
1880 return STbp->syscall_result;
1882 STbp->read_pointer = 0;
1886 if (STbp->syscall_result) {
1920 STbp->buffer_bytes = 0;
1923 STbp->buffer_bytes = bytes - transfer;
1935 STbp->buffer_bytes = (blks - transfer) *
1939 name, count, STbp->buffer_bytes));
1951 STbp->buffer_bytes = 0;
1953 STbp->buffer_bytes =
1957 name, STbp->buffer_bytes));
1964 STbp->buffer_bytes = bytes - transfer;
1966 STbp->buffer_bytes =
1970 name, STbp->buffer_bytes));
1988 if (STbp->buffer_bytes < 0) /* Caused by bogus sense data */
1989 STbp->buffer_bytes = 0;
1993 retval = STbp->syscall_result;
1999 STbp->buffer_bytes = bytes;
2001 STbp->buffer_bytes -= STp->buffer->cmdstat.residual;
2008 STps->drv_block += STbp->buffer_bytes / STp->block_size;
2027 struct st_buffer *STbp = STp->buffer;
2056 STps->eof, STbp->buffer_bytes);
2062 do_dio = STbp->do_dio;
2064 if (STbp->buffer_bytes == 0 &&
2094 if (STbp->buffer_bytes == 0) {
2103 if (STbp->buffer_bytes > 0) {
2108 STps->eof, STbp->buffer_bytes,
2111 transfer = STbp->buffer_bytes < count - total ?
2112 STbp->buffer_bytes : count - total;
2114 i = from_buffer(STbp, buf, transfer);
2155 STbp->buffer_bytes = 0;
4547 static int sgl_map_user_pages(struct st_buffer *STbp,
4556 struct rq_map_data *mdata = &STbp->map_data;
4596 STbp->mapped_pages = pages;
4611 static int sgl_unmap_user_pages(struct st_buffer *STbp,
4617 struct page *page = STbp->mapped_pages[i];
4623 kfree(STbp->mapped_pages);
4624 STbp->mapped_pages = NULL;