Lines Matching refs:chunk
3174 size_t chunk, orig_chunk;
3184 chunk = 4096;
3185 if (len < chunk) {
3186 chunk = len;
3188 orig_chunk = chunk;
3190 if (kmem_alloc(kernel_map, (vm_offset_t *)&buff, chunk)) {
3194 for(pos=start+len-chunk; pos >= start; pos-=chunk) {
3195 ret = vn_rdwr(UIO_READ, xvp, buff, chunk, pos, UIO_SYSSPACE, IO_NODELOCKED|IO_NOAUTH, ucred, &iolen, p);
3198 pos, ret, chunk, ret);
3202 ret = vn_rdwr(UIO_WRITE, xvp, buff, chunk, pos + delta, UIO_SYSSPACE, IO_NODELOCKED|IO_NOAUTH, ucred, &iolen, p);
3205 pos+delta, ret, chunk, ret);
3209 if ((pos - (off_t)chunk) < start) {
3210 chunk = pos - start;
3212 if (chunk == 0) { // we're all done
3227 size_t chunk, orig_chunk;
3238 chunk = 4096;
3239 if (len < chunk) {
3240 chunk = len;
3242 orig_chunk = chunk;
3245 if (kmem_alloc(kernel_map, (vm_offset_t *)&buff, chunk)) {
3249 for(pos = start; pos < end; pos += chunk) {
3250 ret = vn_rdwr(UIO_READ, xvp, buff, chunk, pos, UIO_SYSSPACE, IO_NODELOCKED|IO_NOAUTH, ucred, &iolen, p);
3253 pos, ret, chunk, ret);
3257 ret = vn_rdwr(UIO_WRITE, xvp, buff, chunk, pos - delta, UIO_SYSSPACE, IO_NODELOCKED|IO_NOAUTH, ucred, &iolen, p);
3260 pos+delta, ret, chunk, ret);
3264 if ((pos + (off_t)chunk) > end) {
3265 chunk = end - pos;
3267 if (chunk == 0) { // we're all done