#include <locale.h>
#include <assert.h>
#include <time.h>
+#include <inttypes.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/ipc.h>
unsigned long done_secs = 0;
#define PAGE_ALIGN(buf) \
- (char *) (((unsigned long) (buf) + page_mask) & ~page_mask)
+ (char *) (((uintptr_t) (buf) + page_mask) & ~page_mask)
#define JOB_START_TIMEOUT (5 * 1000)
}
}
+ if (flow_threshold_exceeded(td))
+ continue;
+
io_u = __get_io_u(td);
if (!io_u)
break;
}
}
+ if (flow_threshold_exceeded(td))
+ continue;
+
io_u = get_io_u(td);
if (!io_u)
break;
static int init_io_u(struct thread_data *td)
{
struct io_u *io_u;
- unsigned int max_bs;
+ unsigned int max_bs, min_write;
int cl_align, i, max_units;
char *p;
max_units = td->o.iodepth;
max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
+ min_write = td->o.min_bs[DDIR_WRITE];
td->orig_buffer_size = (unsigned long long) max_bs
* (unsigned long long) max_units;
dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf);
if (td_write(td))
- io_u_fill_buffer(td, io_u, max_bs);
+ io_u_fill_buffer(td, io_u, min_write, max_bs);
if (td_write(td) && td->o.verify_pattern_bytes) {
/*
* Fill the buffer with the pattern if we are
if (td->o.cgroup_weight && cgroup_setup(td, cgroup_list, &cgroup_mnt))
goto err;
- if (nice(td->o.nice) == -1) {
+ errno = 0;
+ if (nice(td->o.nice) == -1 && errno != 0) {
td_verror(td, errno, "nice");
goto err;
}
write_iolog_close(td);
td_set_runstate(td, TD_EXITED);
- return (void *) (unsigned long) td->error;
+ return (void *) (uintptr_t) td->error;
}
td = data + offset * sizeof(struct thread_data);
ret = thread_main(td);
shmdt(data);
- return (int) (unsigned long) ret;
+ return (int) (uintptr_t) ret;
}
/*
}
if (left) {
- log_err("fio: %d jobs failed to start\n", left);
+ log_err("fio: %d job%s failed to start\n", left,
+ left > 1 ? "s" : "");
for (i = 0; i < this_jobs; i++) {
td = map[i];
if (!td)