* Copy len bytes of data from the vm_page_t array, skipping the first off * bytes, into the pointer cp. Return the number of bytes skipped and copied. * Does not verify the length of the array. */
| 194 | * Does not verify the length of the array. |
| 195 | */ |
| 196 | static int |
| 197 | cvm_page_copyback(vm_page_t *pages, int off, int len, c_caddr_t cp) |
| 198 | { |
| 199 | int processed = 0; |
| 200 | unsigned count; |
| 201 | |
| 202 | CVM_PAGE_SKIP(); |
| 203 | while (len > 0) { |
| 204 | count = min(PAGE_SIZE - off, len); |
| 205 | bcopy(cp, (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*pages)) + off, |
| 206 | count); |
| 207 | len -= count; |
| 208 | cp += count; |
| 209 | processed += count; |
| 210 | off = 0; |
| 211 | pages++; |
| 212 | } |
| 213 | return (processed); |
| 214 | } |
| 215 | |
| 216 | /* |
| 217 | * Copy len bytes of data from the pointer cp into the vm_page_t array, |
no test coverage detected