#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <sys/sendfile.h>
#include "blktrace.h"
#include "barrier.h"
}
} while (!is_done() && bytes_left);
- return len;
+ return len - bytes_left;
}
static int read_data(struct thread_information *tip, void *buf, int len)
{
+ int ret;
+
if (net_mode == Net_server)
- return read_data_net(tip, buf, len);
+ ret = read_data_net(tip, buf, len);
+ else
+ ret = read_data_file(tip, buf, len);
+
+ if (ret > 0)
+ tip->data_read += ret;
- return read_data_file(tip, buf, len);
+ return ret;
}
static inline struct tip_subbuf *
ret = read_data(tip, tip->fs_buf + tip->fs_off, maxlen);
if (ret >= 0) {
- tip->data_read += ret;
tip->fs_size += ret;
tip->fs_off += ret;
return 0;
device_information = realloc(device_information, (ndevs + 1) * sizeof(*dip));
dip = &device_information[ndevs];
strcpy(dip->buts_name, buts_name);
+ strcpy(dip->path, buts_name);
ndevs++;
dip->threads = malloc(ncpus * sizeof(struct thread_information));
memset(dip->threads, 0, ncpus * sizeof(struct thread_information));
tip_ftrunc_final(&dip->threads[j]);
}
+ show_stats();
return 0;
}