for (off = 0; off < io_bytes; ) {
b.wait_for(io_threads - 1);
i = 0;
- while (i < io_threads && off < io_bytes &&
- b.start_write(io_threads, thread_offset[i], io_size, bl, op_flags)) {
- ++i;
- ++ios;
- off += io_size;
-
- ++cur_ios;
- cur_off += io_size;
-
+ while (i < io_threads && off < io_bytes) {
if (pattern == "rand") {
thread_offset[i] = (rand() % (size / io_size)) * io_size;
} else {
if (thread_offset[i] + io_size > size)
thread_offset[i] = 0;
}
+
+ if (!b.start_write(io_threads, thread_offset[i], io_size, bl, op_flags))
+ break;
+
+ ++i;
+ ++ios;
+ off += io_size;
+
+ ++cur_ios;
+ cur_off += io_size;
}
utime_t now = ceph_clock_now(NULL);