senders[i].send(mmd->current_chunk, mmd->chunks_sent,
buf, len, vsst->header_buf, vsst->header_len);
}
- mmd->chunks_sent++;
- mmd->current_chunk++;
/*
* Prefault next chunk(s)
*
* eliminate the delays completely. Moreover, it is supported
* only on Linux. So we do our own read-ahead here.
*/
- buf += len;
- for (i = 0; i < 5 && buf < vsst->map + mmd->size; i++) {
- __a_unused volatile char x = *buf;
- buf += 4096;
+ if (mmd->current_chunk > 0) { /* chunk 0 might be on the heap */
+ buf += len;
+ for (i = 0; i < 5 && buf < vsst->map + mmd->size; i++) {
+ __a_unused volatile char x = *buf;
+ buf += 4096;
+ }
}
+ mmd->chunks_sent++;
+ mmd->current_chunk++;
}
}