| 102 | } |
| 103 | |
| 104 | static void |
| 105 | cuio_copyback(struct uio* uio, int off, int len, c_caddr_t cp) |
| 106 | { |
| 107 | struct iovec *iov = uio->uio_iov; |
| 108 | int iol = uio->uio_iovcnt; |
| 109 | unsigned count; |
| 110 | |
| 111 | CUIO_SKIP(); |
| 112 | while (len > 0) { |
| 113 | KASSERT(iol >= 0, ("%s: empty", __func__)); |
| 114 | count = min(iov->iov_len - off, len); |
| 115 | bcopy(cp, ((caddr_t)iov->iov_base) + off, count); |
| 116 | len -= count; |
| 117 | cp += count; |
| 118 | off = 0; |
| 119 | iol--; |
| 120 | iov++; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 | * Return the index and offset of location in iovec list. |
no test coverage detected