void *buf;
uint64_t pos = start;
uint64_t data_off = pos, data_end = pos;
+ uint64_t mirror_end = LUSTRE_EOF;
uint32_t src = 0;
int i;
int rc;
now = last_bw_print = start_time;
while (pos < end) {
- uint64_t mirror_end;
ssize_t bytes_read;
size_t to_read;
size_t to_write;
+ size_t data_size;
if (pos >= data_end) {
off_t tmp_off;
- size_t data_size;
if (pos >= mirror_end || !src) {
rc = llapi_mirror_find(layout, pos, end,
*/
rc = llapi_mirror_truncate(fd, mid,
cur_pos);
- else
+ else if (to_punch)
rc = llapi_mirror_punch(fd, mid,
cur_pos, to_punch);
/**
- * hole at the end of file, so just
- * truncate up to set size.
+ * hole at the end of file, so just truncate up
+ * to set size.
*/
- if (!rc && data_off == data_end &&
- data_end == stbuf.st_size)
+ if (!rc && data_off == data_end && !data_size)
rc = llapi_mirror_truncate(fd,
mid, data_end);